Repository navigation
feat(storage): share physical admission across scanner and heal - #8911
Merged
Merged
Conversation
Contributor
|
CLA requirements are satisfied for this pull request. |
overtrue
force-pushed
the
overtrue/scanner-node-feedback
branch
from
October 25, 2026 03:43
1743834 to
b2006b7
Compare
overtrue
force-pushed
the
overtrue/physical-disk-admission
branch
from
October 25, 2026 03:50
24513d9 to
23c62f5
Compare
houseme
approved these changes
Oct 25, 2026
Merge origin/main 69f8e36. Conflicts were resolved against the squash-merged node admission (#8903) by using its pre-squash head as the review base. Main behavior wins where both sides changed the same path; the physical admission, memory reservation and shutdown join changes from this branch are kept on top. - hotpath follows main's 0.30.1 release; the fork pin is dropped. - write_all_internal keeps owned Bytes and adopts main's coalesced parent creation inside the same blocking job. - The MRF pending-lifecycle wait also observes the consumer stop token. - Scanner node cancellation returns the node slot while started native work keeps only its captured physical leaves.
Merge origin/main 589b499 (CI-only workflow and test-contract update).
Route the multipart lock diagnostics filter through the e2e storage compatibility module, reuse the parent module's s3s body aliases in the namespace memory test, and share one Reed-Solomon verify error mapping across the reserved-buffer and default paths.
Main added a source-admission metadata write layer, a CAS write fence, fixture writers and scanner handoff tests against the old borrowed-slice and node-permit shapes. Pass owned Bytes through the new metadata layer, answer the scanner handoff with ScannerNodePermit, gate the test-only disk lookup re-export, and clear the lint findings that stable 1.99 reports for the shutdown and admission code without suppressions.
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned Files
|
Every LocalDiskWrapper operation reaches the LocalDisk future through the health, admission and timeout layers (track_cleanup_mutation, the track_disk_health family, the io-permit and native-resource admission split, and track_admitted_disk_operation). Each layer embedded that future, and unoptimized builds copy it into every awaiting frame, so one local delete cost about 1.3 MiB of stack and 16 tests overflowed libtest's default 2 MiB stack. Box the operation future once where track_admitted_disk_operation creates it, through a non-async helper so the temporary never stays in a polled frame. The layers above now hold only a pointer; the cost is one allocation per local disk operation.
The admission wrappers took the object heal future by value, so unoptimized builds copied it into three awaiting frames, about 650 KiB per heal. Create it through a non-async helper instead, leaving only a pointer in those frames.
overtrue
marked this pull request as ready for review
October 30, 2026 15:24
…mission # Conflicts: # crates/ecstore/src/disk/local.rs # crates/ecstore/src/disk/os.rs
houseme
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Part of rustfs/backlog#2881; builds on #8903 (merged). This does not establish a fix for #8377's macOS CPU bursts.
Summary of Changes
Head:
cb97f62380c8bc9ed7aa0a0e9bbbe6241942645f, one stack-depth fix on top of1ef92a516a5a980a23048b65956ffecece705988, which mergesorigin/main(589b499e3) into the previous headba1386a0fc5bea184c4eadc8369c04775f060ce9(based on #8903 at040720aa58c810279be3ab2343be8247f13d4cf7). Verification bullets after the main-sync entries predate the sync unless they say otherwise.Verification
5eb301a803b97898dd61141cc0bcc3d4da3fb2b6mergesorigin/maininto the previous headba1386a0fc5bea184c4eadc8369c04775f060ce9(merge7c779ec7fwith69f8e364b, then a clean CI-only merge3f893f35cwith589b499e3), followed by two fix commits; no rebase or force-push. Because feat(scanner): share node admission with background heal #8903 was squash-merged, conflicts were resolved with its pre-squash base040720aa5as the three-way base, which removed the duplicated feat(scanner): share node admission with background heal #8903 conflicts. Main wins where both sides changed a path; this branch's physical admission, memory reservation and shutdown join changes stay on top.0.30.1(the fork pin and its source-policy entry are dropped; the code only usesMeasurementGuardSync::newand#[hotpath::measure], unchanged in 0.30.1).write_all_internalkeeps ownedBytesand adopts main's coalesced parent creation inside the same blocking job; main's new source-admission metadata layer and pool-meta native recovery write now passBytes. Whole-file reads keep the reservedBackgroundBufferand adopt main'stake(len)bound and pre-sizing. The CAS control-file write keeps the mount lease and adds main'scommit_allowedcheck. Scanner node cancellation (feat(scanner): share node admission with background heal #8903) returns the node slot while started native work keeps only its captured physical leaves. The MRF pending-lifecycle wait (fix(heal): gate unresolved MRF lifecycle writes on reader support #8918) also observes the consumer stop token and finalizes on closed channels. Replacement heal keepsheal_object_with_task_cancelinside main's retry loop (fix(heal): pace and parallelize replacement recovery #9005).ba1386a0f(the e2e lock-diagnostics filter moved into the e2e storage compatibility module, the namespace memory test reuses the parent module's s3s aliases, and one shared Reed-Solomon verify error mapping restores the::other(format!baseline) plus Clippy 1.99 findings, without suppressions or baseline changes.capture_nativeleaves are scoped and the node permit is dropped on cancellation); buffers that leave a scope keep their own memory reservation; the scanner bucket-cache coordinator drops its lease before any node or physical wait and revalidates revisions afterwards; scanner-side heal only enqueues for an admission receipt, so inline heal does not wait on the node quota the scanner holds.5eb301a80(macOS, Rust 1.99.0, debug):cargo fmt --all --checkandgit diff --checkpass;cargo clippy -p rustfs-concurrency -p rustfs-ecstore -p rustfs-scanner -p rustfs-heal -p rustfs-rio -p rustfs-data-usage -p rustfs -p e2e_test --all-targets --locked -- -D warningsexits 0; the unsafe, architecture-migration, logging, error-ratchet, tokio-io-uring, body-cache, s3s-footprint, FIPS-wording, embedded-secrets, doc-path and planning-doc guards exit 0;test_scanner_abba.py35 passed and the scanner validation harness exits 0.cargo nextest run --profile ci --locked --no-tests fail --lib: concurrency 87/87, data-usage 57/57, rio 218/218, scanner 1249/1249, ecstore with--features test-utilfiltered todisk::,erasure::coding,io_support::bitrot,core::pool_meta_recovery_codecandset_disk::ops::heal1344/1344, rustfs filtered to background admission, startup, node/HTTP RPC and server HTTP 404/407, heal 984/997 (one existing ignored W13 evidence test not run).node_serviceRPC fixtures) overflowed libtest's default 2 MiB test stack. A frame-pointer walk at the overflow (a temporary local SIGSEGV probe, not committed) showed the four heal fixture families share one chain:LocalDiskWrapper::delete->track_cleanup_mutation->track_disk_health_with_op_timeout_action_and_mutation->..._with_io_permit->with_native_resources->track_admitted_disk_operation, each a 160-280 KiB unoptimized frame (about 1.3 MiB together). Every layer embedded theLocalDiskoperation future, and debug builds copy it into each awaiting frame; the last three layers are this PR's admission split.cb97f6238boxes that future once wheretrack_admitted_disk_operationcreates it, through a non-async helper (boxed_disk_operation) so the temporary does not stay in a polled frame. No stack size, nextest setup script, test or allowance changed. Minimum passingRUST_MIN_STACK(64 KiB bisection, debug, macOS) went from 2112-2368 KiB to 768-1152 KiB for 12 of the 13 heal tests. The MRF partial-write test went from 2624 to 1920 KiB: its remaining depth is main's unchangeddelete_bucket->put_objectchain, and on main589b499e3one of these 13 tests already failed at 1.75 MiB.flush()delegates toflush_pending_lifecycle, which can keep returning false (for example when the pending record is no longer active).finalize_mrf_consumerretries failed flushes until one succeeds, so a stop during that state waits for Root's absolute shutdown deadline. The new stop arm does not change this (the loop-top check reaches the same finalize); it was not changed here.LocalDiskWrappercall routed throughtrack_admitted_disk_operation, so there is one allocation per local disk operation, not per shard dispatch or byte. A standalone release micro-benchmark (macOS system allocator; production uses mimalloc) measured +25-60 ns per boxed future of 0.5-8 KiB and +125-250 ns at 32 KiB. Each of these operations already dispatches to the blocking pool and performs filesystem syscalls, which take microseconds or more. Release-build future sizes and release stack headroom (1 MiB Linux workers) were not measured: the host volume was below 1% free, too little for a release build.cb97f6238(macOS, Rust 1.99.0, debug, default stack,cargo nextest run --profile ci --locked --no-tests fail --lib): the 13 former heal overflows 13/13; full heal lib 997/997 (1 skipped: the existing ignored W13 test); scanner + concurrency 1335/1336. The single scanner failure,usage_expiration::lifecycle_expiration_usage_converges_across_complete_scans, returnsDiskFullbecause the host volume had less than the 1% free thatDISK_FILL_FRACTIONrequires. It fails the same way in isolation, is independent of this change, and passed on5eb301a80.cargo clippy -p rustfs-ecstore --all-targets --features test-util --locked -- -D warnings(test-utilmatches the workspace feature set; without it, main's fix(rebalance): reuse the target pool holding a dangling copy #9018PoolSpaceForTestre-export is unused),cargo fmt --all --check,git diff --checkand the same 11 guards pass. Not run locally: the 3 rustfsnode_serviceRPC fixtures, because building the rustfs test library needs several GB and its fixtures hit the sameDiskFullthreshold. They reach the sameLocalDiskWrapperfunnel and are left to CI.1ef92a516only renames the reversed-group variables in twopermit_settests after the PR Typos check flaggedba; on it,typos,cargo fmt --all --check,cargo clippy -p rustfs-concurrency --all-targets -- -D warningsand the concurrency lib tests (87/87) pass. The other sync checks above ran on5eb301a80, whose non-test code is identical.check_test_wiring.py,ci_gate.py --check-workflow) need PyYAML, which is not installed; no cluster/e2e runs, G-EXP/G-REB/G-DEC topology gates, ABBA or performance runs on this shared machine. Main has since gained fix: preserve PUT lock failure diagnostics #9062 (PUT lock diagnostics), which merges cleanly and was not tested here.e2e_testpackage passedcargo check -p e2e_test --tests --offline --lockedwith its original lock and actual default test target. No cluster test ran in that local gate. Only the metadata-delay case enables the existing targeted lock diagnostics before its four nodes start; these logs are not proof of unlock ACKs. The underlying 503 remains unresolved.cargo test --offline --locked --lib --no-run -p rustfs --features rustfs/e2e-test-hooksand the corresponding HTTP/3 and Linux/musl builds. These are debug, scoped checks; they do not establish live QUIC/native retirement or SSD performance.17ce7097c41511618ca13ac2249527d201c719a0passed all 73 selected distributed tests and both upgrade compatibility jobs. The earlier metadata-fault 503 remains a recorded failure with an unresolved cause; a later green run does not establish a fix. This diagnostic change preserves the original five-, twenty- and forty-five-second budgets, fault and quorum assertions, and single SDK attempt.1fbda624c90588a687974d22eecda9a84e409a54failed the distributed multipart metadata-fault case: Complete returned a real namespace-lock timeout 503 before the selected Rename fault was reached. Both upgrade compatibility checks passed. The lock failure remains unresolved; this HTTP change does not establish a fix.cargo test --offline --locked --lib --no-run -p rustfs-heal -p rustfs --features rustfs/e2e-test-hooksandcargo-zigbuild test --offline --locked --lib --no-run -p rustfs-heal -p rustfs --target x86_64-unknown-linux-musl --features rustfs/e2e-test-hooks. Actualrustfsandrustfs-clibinaries returned the expected success/error codes. These are debug builds and early hooks, not post-storage shutdown or matched-release SSD proof.TimedOut, requests no marker clear and joins the real task. The new actual Root module test covers late success and late panic with the original JoinError identity. Other component services are stubs; this is not full service retirement proof.Impact
Adaptive admission remains off by default; this PR stays draft. Enable it only when every peer supports the signed background marker. Older peers and disabled receivers reject marked requests. Foreground signatures, placement, quorum and storage/wire formats are preserved. Device admission is not an OS bandwidth limit.
The io_uring completion-owner API is fixed to
eb8fc160e71d804427de1e905f5c226d580f71bffrom rustfs/uring#20. Hotpath now follows main's crates.io0.30.1; the earlier RustFS fork pin and its Git source-policy entry were dropped in the main sync, so only the uring repository is added to the Git source policy. A prefix receipt is not a producer-quiescence certificate.Open gates include decoded/cache models, other RPC serializers, transport/allocator overhead and RSS; later Auto readiness/intent migration, terminal-receipt GC, cross-set bucket metadata and retirement records; gRPC bucket receiver ownership and retryable quota round trips; the real page/nonempty-lease chain; all Root ingress/native/source retirement and ordered profiling drain. Default and legacy paths remain available. Resume GC may defer its first cold-start tick before sampling; its hourly cadence is unchanged.
Same-bucket cold/hot attribution, clone bytes, common multi-node windows, exact client percentiles, matched release builds, oracle/fault/MRF/mixed-version/hot-shrink, the complete SSD matrix and 72-hour soak remain unverified. The earlier short ABBA's 503s and 24.51% p99 drift remain failures. HDD and Windows runtime are unverified.
Additional Notes
Scoped independent reviews covered correctness/concurrency, security/compatibility and simplicity/performance. They do not replace the open service and resource-ownership gates above.
Rollback: revert the change. Adaptive admission can also be disabled on all peers; the shutdown fixes apply independently. No data migration is needed.