Repository navigation
test(e2e): size the bundle multi-source entry so a late holder splits it - #2743
Merged
Merged
Conversation
cli_bundle_pull_multi_source required one `decdn get` to split its 640 KiB large entry across both holders. An entry's probe round starts the fetch at the first holder that answers, so the first plan usually held one lane, and that lane opened one leg for the whole blob. The other holder joined a few milliseconds later, but ADR 039 splits no range below min_split_size (16 MiB) for a late lane. A pull split the entry only when both holders answered before the round returned: 6 of 82 pulls across 6 local runs. The 90 s retry ladder sometimes ran out. The client and the ADR agree: a small blob splits only across the lanes of the first plan. The entry is now 4 x min_split_size (64 MiB), so the late holder steals half of the missing bytes. 20 debug-logged runs each split on the first pull, by that steal. Closes #2741 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the fixture-size adjustment addressing the multi-source test flake.
No open issues 🎉
What changed in this PR
This PR addresses the flaky bundle multi-source end-to-end test in #2741 by enlarging its fixture to support late-holder splitting under the existing client behavior. Client code and ADR 039 remain unchanged.
Changes:
- Increases the large entry from roughly 640 KiB to 64 MiB plus 777 bytes, giving a late holder more time to split the remaining range.
- Explains the sizing rationale and retains retries for payment-pool watcher readiness.
| File | Description |
|---|---|
crates/e2e/tests/cli_bundle_pull_multi_source.rs |
Enlarges the large-blob fixture and documents late-holder splitting and readiness retries. |
CHANGELOG.md |
Records the test flake’s cause and fixture-size fix. |
Review effort: Balanced
thiras
force-pushed
the
fix/2741-bundle-multi-source-split
branch
from
October 28, 2026 23:37
7a83c81 to
ac309db
Compare
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 4 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
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.
Summary
cli_bundle_pull_multi_sourceasserted a split that ADR 039 does not promise for its 640 KiB large entry. The fix is in the test. The client and the ADR are unchanged.Cause. A bundle entry's probe round streams (
ProbeRound::Stream): the fetch starts at the first holder that answers, and the holders that answer later join it. With one lane, the first plan gives that lane the whole blob, and the lane opens one leg for it at once. The second holder joins a few milliseconds later. A late lane splits a range only while the range misses at leastmin_split_size(16 MiB, ADR 039 § Dynamic segmentation and tail-stealing, acceptance criterion 6). So the 640 KiB entry split only when both holders answered before the round returned, and both lanes landed in the first plan.Client debug log of a typical attempt (large entry
4c40c3…, 656137 bytes):Across 6 local runs on
main(82decdn getattempts), the large entry's first plan hadlanes=1in 76 attempts andlanes=2in 6. The retry ladder passed each run only after up to 23 attempts (54 to 60 s of its 90 s budget). When the ladder ran out first, the run failed as in #2741.Why not the client. The ADR states that a lane joins when discovery finds it, and that a late lane does not split a range below
min_split_size. The objective is to fill the client's downlink, not to use N sources. Waiting for more probe answers before the first plan would add latency to every small fetch and undo the streamed round. Splitting a sub-16 MiB range that a lane already streams would open a new paid stream for a tail the ADR floor exists to refuse. Theplan_pendingdoc ("a small blob still engages every full holder from the start") is about the lanes in the first plan. It holds.Fix. The large entry is now
4 × min_split_size+ 777 bytes (64 MiB). The split no longer depends on which holder answers first. When both holders are in the first plan, each gets half. When one holder joins late, it steals half of the missing bytes, unless the first lane has already fetched three quarters of the blob. In the runs below, the late holder joined about 35 ms after the plan, with 48 KiB fetched, and the first lane needed about 3.5 s for 48 MiB:The retry ladder stays, because a holder whose watcher has not seen the new pool refuses the stream. It now covers only that readiness.
Test plan
binary(cli_bundle_pull_multi_source),--retries 0: 25 runs, 25 passed (1 test each). In 20 of them, run with the client debug log, every run split the entry on its firstdecdn get, each time by the late holder's steal.MIN_SPLIT_SIZEraised to 128 MiB, so no late lane can steal from the 64 MiB entry, 3 runs took 41 attempts with no steal: 1 run failed the 90 s ladder as in e2e: cli_bundle_pull_multi_source flakes: no single pull splits the large entry across both holders #2741, and 2 passed only on a rarelanes=2first plan (24, 9 and 8 attempts). Restored from a copy and touched.binary(peer_store_probeless)×10: 7 of 10 passed. The 3 failures are the client: the size open's primed whole-blob pull is closed when another lane builds in the same first batch #2740 signature (the holders wrote 397476 bytes for a 198610-byte pull), which the open fix(client): start the size open's lane before any other lane builds #2742 fixes. This PR changes no client code.cli_fetch_multi_source,cli_fetch_recovers_one_holder,cli_bundle_pull_range_dedup: each passescargo nextest run -p decdn-client --no-fail-fast: 1200 passedcargo clippy --workspace --all-targets --all-features -- -D warnings,cargo fmt -- --check,CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items: each exits 0Closes #2741
🤖 Generated with Claude Code