Repository navigation
feat(cli,client): stripe a range-dedup entry's ranges across its holders - #2143
Conversation
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 6d291fc in the Show a line coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical error-handling and peer-blame issues, plus a moderate failover issue, remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Adds range-dedup striping across admitted full holders using shared storage, multi-lane driving, failover, and signed-size validation.
Changes:
- Adds multi-lane range driving and settlement.
- Updates bundle holder admission, session striping, and failover.
- Adds tests, API snapshots, changelog, and ADR updates.
Review findings:
- Critical: local I/O failures may incorrectly blame healthy peers.
- Critical: one-lane post-completion faults may be swallowed.
- Moderate: ownerless drive failures must clear all open sessions.
- Nits: fix changelog wording and add unprimed size-mismatch coverage.
| File | Description |
|---|---|
crates/e2e/tests/cli_bundle_pull_range_dedup.rs |
Adds striped-holder end-to-end coverage. |
crates/common/src/cli/fetch.rs |
Documents max_sources usage. |
crates/client/tests/snapshots/public_api__public_api.snap |
Updates the public API snapshot. |
crates/client/src/scheduler.rs |
Adds stoppable multi-source fetching. |
crates/client/src/ranged_store.rs |
Fixes empty-prefix presence tracking. |
crates/client/src/lib.rs |
Exports new client APIs and errors. |
crates/client/src/driver.rs |
Implements multi-lane driving and size checks. |
crates/client/src/downloader.rs |
Adds stoppable downloader support. |
crates/cli/src/commands/fetch.rs |
Adds shared-store striping and lane settlement. |
crates/cli/src/commands/bundle_pull.rs |
Adds holder striping and session failover. |
CHANGELOG.md |
Documents behavior changes and fixes. |
adr/appendix-bundles.md |
Updates bundle range-dedup design. |
adr/039-multi-source-parallel-fetch.md |
Documents the multi-source throughput floor. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| let collective = outcome.drive_error().is_some_and(blames_the_peer) | ||
| && (0..lanes.len()).all(|i| outcome.lane_fault(i).is_none()); |
There was a problem hiding this comment.
Fixed in 6d291fc, which came after this review. drive_stripe now blames every lane only when the drive error is the floor (EntryStalled). A local store, flush or finalize fault blames no peer. SessionWalk also ends on a local disk fault (is_local_disk_fault) and does not fail over to the reserve. Covered by session_walk_stops_on_a_local_disk_fault.
| if !self.unfinished { | ||
| return Ok(()); | ||
| } | ||
| let decisive = self.faults.into_iter().flatten().reduce(keep_decisive); | ||
| Err(decisive.unwrap_or_else(|| anyhow::anyhow!("the range set was left unfinished"))) | ||
| } |
There was a problem hiding this comment.
Fixed in 6d291fc, a little more broadly than suggested. A drive now fails when every lane faulted, not only when faults.len() == 1, and it is then not finalized. For one lane this restores the old drive_range_set contract. For several lanes it means a drive where every lane faulted, including after its bytes landed, reports a failure, so each lane settles high. A multi-lane drive where some lane served cleanly still succeeds. Regression test: a_fault_after_the_last_byte_fails_a_pooled_one_lane_drive (a fault in finish after the last byte). It fails without the fix.
|
Multi-agent review follow-up, 52c822b. It ran code, tests, silent failures, comments and type design over the whole branch. Fixed
New tests: the regression above, a parked lane that wakes to fill a faulted lane's gap (under a timeout), Left as is
Local runs: clippy, rustdoc and fmt pass. 1673 client/cli/common tests, 1265 node tests (no flakes this run) and 11 anvil e2e tests pass. |
52c822b to
c4919dd
Compare
A range-dedup entry paid for its scattered complement over one provider's link even when several holders were probed. - client: `drive_range_lanes` fills a range set across several `RangeLane`s from one gap queue. A lane that faults retires and its gap's missing rest goes back to the queue. A terminal fault stops every lane. The first gap waits for the lane that holds the primed first leg. `RangeSetOutcome` reports each lane's fault and the drive's result. `drive_range_set` is the one-lane case. - cli: `FetchPrelude` no longer owns a store. A range-dedup entry opens one ranged store that every session of every drive writes into. `drive_stripe` runs the entry's sessions under one drive-level floor and one top-up budget, then settles each lane at its armed cumulative unless its voucher was rejected. - bundle pull: `stripe_order` puts the admitted full holders first (one per operator, at most --max-sources, with multi-source on). `SessionWalk` opens the stripe up front, drops a faulted lane, fails every lane over on a drive-level failure, and falls back to the reserve one candidate at a time. Only the last session a pass opens primes the first leg. Refs #2123 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- A drive whose every lane faulted fails, even when its bytes landed: a fault in the closing voucher exchange can leave a voucher armed. A pooled one-lane drive returned Ok there and settled the lane low. It is not finalized either. - Only a floor trip blames every striped lane; a local fault of the drive blames none. Each lane fault is logged with its provider. Worker store errors fold through keep_decisive instead of being dropped. - SessionWalk ends on a local disk fault as on a terminal one, treats a session with no fault report as faulted, and keeps an error that rules out a retry round over a later transient one. - drive_range_lanes refuses more than one lane that takes the first gap. - Doc fixes: settle rationale, pinned reopen, RangeTargets stripe of one, the module doc's CLI callers, the ADR and CHANGELOG stripe failover. Refs #2123 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
c4919dd to
6d291fc
Compare

Refs #2123 (bullet: stripe a range set across providers)
A range-dedup entry paid for its scattered complement over one provider's link, even when several holders were probed (the gpt-oss
original/model.safetensorscase in #2119). The entry now stripes its ranges across its admitted full holders.Design
stripe_order): the probed holders whose coverage spans the whole blob, admitted as the multi-source fan-out admits (admit_sources): one node per operator, at most--max-sources.drive_range_lanesfills a range set across severalRangeLanes (source, ctx, ledger, width) from one gap queue into one store.retry_disposition) stops every lane.RangeSetOutcomereports each lane's fault and the drive's result.drive_range_setis now the one-lane case. Its behaviour is unchanged, and all its existing tests pass as they are.FetchPreludeno longer owns a store. A range-dedup entry opens oneClientRangedStore, and every session of every drive writes into it. Before this, each session opened its own store on the staging path, and two concurrent writers would overwrite each other's.rangesrecord.drive_striperuns the entry's sessions under one drive-level floor and one top-up budget, then settles each lane.committed. Any other lane settles at the armedsettlement, asmulti_lane_watermarksdoes.SessionWalk):PRIMED_MAX_IDLE).--node-id, K=1 open/drive order, and error text are unchanged, and the existing walker tests pass.SignedSizeMismatch, infill_gap). Unprimed stripe sessions skip the first-open size check, so without this a wrong manifest size would fail bao verification on every lane. That would blame honest peers and start useless retry rounds. The mismatch is not blamed on the peer and starts no retry round.Review follow-ups (folded into this commit)
An independent review pass found:
committedon a voucher rejection could land below another gap's armed voucher on the same lane. It now always settles high unless the lane was clean.Known trade-off
Tests
driver.rs:a_range_set_spreads_its_gaps_across_lanesa_faulted_lane_retires_and_the_others_fill_its_gapsa_terminal_fault_stops_every_lanea_set_every_lane_fails_is_left_unfinishedonly_the_lane_that_takes_the_first_gap_opens_itseveral_lanes_without_a_shared_pool_is_an_errora_leg_whose_signed_size_disagrees_with_the_store_is_refusedbundle_pull.rs:stripe_order_*(2 tests).FakeSessionsadapted, and the 4 existing walker tests are unchanged.cli_bundle_pull_stripes_a_complement_across_two_holders: two bonded holders, discovered pull.a's whole file plusb's complement once.b's ranges.Local verification
-D warnings --all-targets --all-features, rustdoc-D warningsand fmt all pass. The public-api snapshot is regenerated.nextest -p decdn-client -p decdn-cli -p decdn-common --all-features: 1667 pass.-p decdn-node: 1265 pass.client_loopback::a_warm_peer_source_drives_a_range_set_on_one_connectionandnode_origin_pull::concurrent_pulls_resume_at_their_own_frontier_not_the_channelseach failed once, then passed on retry.--retries 0or in 25 isolated runs of the loopback test.cli_bundle_pull_range_dedup,cli_bundle_pull_multi_source,cli_fetch_multi_source,cli_fetch_resume): 11 pass.Not yet confirmed on testnet. Only bcl holds the gpt-oss blob today. A second full holder is needed to see the complement stripe there.
🤖 Generated with Claude Code