Skip to content

fix(node,cache): seed a serve-miss outboard only from held ranges inside its range - #2207

Merged
thiras merged 1 commit into
mainfrom
fix/2205-serve-miss-seed-scope
Sep 28, 2026
Merged

thiras merged 1 commit into
mainfrom
fix/2205-serve-miss-seed-scope

Conversation

@thiras

@thiras thiras commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

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_outboard called outboard_pairs over every held range of the blob. export_bao reads 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 to serve_miss_pull grew from 2.4 s to 8.2 s over the run. The primed handshake pull also idled past PRIMED_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_ranges clips the seed to present ∩ the stream's own chunk-group-aligned range. That is the only span whose proof nodes the coherent encoder loads.
  • serve_end and encoded_ranges (serve_encoder.rs) compute that range for the serve leg, the encoder and the seed, so they cannot drift apart.
  • A failed seed (a present_ranges or outboard_pairs fault) logs a WARN. 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

  • Read held_seed_ranges and seed_held_outboard in window.rs first.
  • Why the clip is safe. The encoder loads only parents whose spans meet its aligned range. Parents over the held part come from the seed. Parents over the absent part come from the pull's admit capture. Each serve leg, including Attach and Mixed observers, seeds its own range.
  • Behaviour change. A corrupt held range outside the request no longer aborts the stream. The first stream that covers that range quarantines the hash.
  • Not fixed here. After the pull ends, the same trace spends 9.6 s serving the rest at ~2.6 MB/s. The rerun shows whether this needs its own issue.

Verification

  • cargo fmt -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo nextest run -p decdn-node -p decdn-cache: 1935 passed
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items
  • New unit tests (window::tests) failed against the unclipped seed.
  • New integration tests a_bounded_miss_seeds_only_the_held_ranges_inside_it (own-origin) and window_pull_through_bounded_miss_seeds_only_the_held_ranges_inside_it (peer). Both fail when the seed is forced empty, and so does interior_hold_own_origin_miss_pulls_only_the_gaps. The peer test passed 5/5 with --retries 0.
  • User-visible change: CHANGELOG.md entry added
  • Anvil e2e not run
  • Testnet, after deploy: rerun decdn bundle pull --hash 9194000d… --namespace 1. Expect entry 7cbb4846… at or above 5 MB/s per stream, and near-zero gaps from handshake to serve_miss_pull in lon1's traces.

🤖 Generated with Claude Code

…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]>
Copilot AI lite review requested due to automatic review settings September 28, 2026 07:19
@thiras thiras self-assigned this Sep 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 13ecc4d in the fix/2205-serve-miss-... branch remains at 86%, unchanged from commit 7bba614 in the main branch.

Show a line coverage summary of the most impacted files.
File main 7bba614 fix/2205-serve-miss-... 13ecc4d +/-
crates/client/src/scheduler.rs 95% 95% 0%
crates/node/src...nt/serve_leg.rs 91% 91% 0%
crates/node/src...gin/pull_leg.rs 88% 89% +1%
crates/node/src...erve_encoder.rs 92% 93% +1%
crates/node/src...lient/window.rs 72% 75% +3%

@thiras
thiras merged commit 8886c85 into main Sep 28, 2026
31 checks passed
@thiras
thiras deleted the fix/2205-serve-miss-seed-scope branch September 28, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants