Repository navigation
fix(node,cache): seed a serve-miss outboard only from held ranges inside its range - #2207
Merged
Merged
Conversation
…ide its range (#2205) Before it spawned the upstream pull, every serve-miss stream seeded the shared outboard from all of the blob's held ranges. `outboard_pairs` reads and verifies every leaf it exports, so each stream start re-hashed every byte the node held of the blob. On the testnet, lon1 proxying a 13.5 GiB entry waited 2.4 s to 8.2 s per stream before its pull began. The primed handshake pull also idled past its 2 s adoption limit, so the node opened the same range again and forfeited its carried ramp credit at the holder. The seed now covers only the held part of the stream's own chunk-group-aligned range: the only span whose proof nodes the coherent encoder loads. `serve_end` and `encoded_ranges` compute that range for the serve leg, the encoder and the seed alike. A failed seed logs a WARN instead of surfacing later as an unexplained "outboard node never captured". Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The change set warrants final human review, with a documentation nit still noted.
Review effort: Lite
Findings: None
What changed in this PR
This PR reduces serve-miss startup latency by limiting outboard seeding to held ranges within the requested span.
Changes:
- Shares serve-range calculations between serving and seeding.
- Clips and logs held-range outboard seeding.
- Adds unit and integration coverage.
- Updates the changelog.
| File | Summary |
|---|---|
crates/node/tests/origin_range_pull.rs |
Tests bounded own-origin misses. |
crates/node/tests/node_origin_pull.rs |
Tests bounded peer pull-through misses. |
crates/node/src/handlers/client/window.rs |
Clips and logs held-range seeding. |
crates/node/src/handlers/client/serve_leg.rs |
Reuses shared serve-end calculation. |
crates/node/src/handlers/client/serve_encoder.rs |
Centralizes serve-range calculations. |
crates/cache/src/engine.rs |
Documents bounded outboard export cost. |
CHANGELOG.md |
Documents the performance fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 13ecc4d in the Show a line coverage summary of the most impacted files.
|
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.
What
A two-leg proxy-warming miss served at ~1.8 MB/s per stream (#2205). The upstream leg is not the cause: lon1 pulled a 49.9 MB range from bcl in 6.27 s. Each stream stalled before its pull started.
Before it spawned the pull,
seed_held_outboardcalledoutboard_pairsover every held range of the blob.export_baoreads and verifies every leaf it exports, so each stream start re-hashed every byte lon1 held of the 13.5 GiB blob. The Tempo gap from the handshake open toserve_miss_pullgrew from 2.4 s to 8.2 s over the run. The primed handshake pull also idled pastPRIMED_MAX_IDLE(2 s), so the pull opened the same range again and forfeited lon1's carried ramp credit at bcl. The evidence, and the causes ruled out (relay path, path churn, bcl saturation), are in this comment.held_seed_rangesclips the seed topresent ∩the stream's own chunk-group-aligned range. That is the only span whose proof nodes the coherent encoder loads.serve_endandencoded_ranges(serve_encoder.rs) compute that range for the serve leg, the encoder and the seed, so they cannot drift apart.present_rangesoroutboard_pairsfault) logs aWARN. It no longer fails silently and then surfaces later as "outboard node never captured".Refs #2205. The issue stays open until the testnet rerun confirms the rate.
Reviewer notes
held_seed_rangesandseed_held_outboardinwindow.rsfirst.Verification
cargo fmt -- --checkcargo clippy --workspace --all-targets -- -D warningscargo nextest run -p decdn-node -p decdn-cache: 1935 passedRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-itemswindow::tests) failed against the unclipped seed.a_bounded_miss_seeds_only_the_held_ranges_inside_it(own-origin) andwindow_pull_through_bounded_miss_seeds_only_the_held_ranges_inside_it(peer). Both fail when the seed is forced empty, and so doesinterior_hold_own_origin_miss_pulls_only_the_gaps. The peer test passed 5/5 with--retries 0.CHANGELOG.mdentry addeddecdn bundle pull --hash 9194000d… --namespace 1. Expect entry7cbb4846…at or above 5 MB/s per stream, and near-zero gaps from handshake toserve_miss_pullin lon1's traces.🤖 Generated with Claude Code