Skip to content

fix(node): name the walk on a pull_leg_miss refusal and give the upstream probe one second - #2533

Merged
thiras merged 3 commits into
mainfrom
fix/pull-leg-miss-trail-2366
Oct 18, 2026
Merged

thiras merged 3 commits into
mainfrom
fix/pull-leg-miss-trail-2366

Conversation

@thiras

@thiras thiras commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What

Two commits for #2366 (bonded non-holders refusing pull-through with pull_leg_miss cause=clean_miss).

The 13 hel1 refusals in the 2026-10-18 batch are three mechanisms, not one. Cross-referencing each refusal minute with the per-minute node counters and the Tempo dht_lookup / serve_stream spans:

Mechanism Refusals Evidence
The only candidate's probe fails ~6 each refusal minute moves decdn_node_pull_unreachable_total by one; the 12:18:39 triple is three concurrent serves whose probes of the same sole candidate failed at the same instant, while bcl was serving hel1 legs of the same blob throughout
Discovery names nobody 4 (13:02–13:03, one blob) decdn_node_pull_no_providers_total +4 in those minutes; staker set stayed 9, directory RPC failures 0
Nothing counted ~3 no unreachable, no-providers, refusal, backpressure or pool-open counter moved

Commit 1 — a pull_leg_miss refusal names the walk that found no target

The fleet logs at info, and the line said only cause=clean_miss. open_pull_leg now returns a PullLegMiss { miss, trail }, and the serve-miss: refusing the request line records the PullLegTrail: source (cache / dht / directory / none), discovered, skipped (negative-cached or wedged before probing), probed, unreachable, absent (has_blob: false), dropped (shed, unverifiable, inconsistent, no address), holders, spans, handshakes, and last_fault (the last handshake's verdict or pool-open arm). Every serve-miss refusal line also carries the request's namespace_id, which settles whether the four no-providers refusals were namespace-0 requests.

  • probe_candidate returns Result<Candidate, ProbeDrop>; the probe round tallies each drop. Side effects are unchanged.
  • discover returns Discovered { providers, source }.
  • handshake_total_bytes returns a HandshakeFault { miss, why }; PullVerdict::as_str and PoolOpenArm::as_str name the fault.
  • No new metrics: the sibling counters exist; the line adds per-refusal attribution.

Commit 2 — the node's upstream probe budget is 1 s

PROBE_TIMEOUT was 500 ms. A probe dials a fresh connection, so it costs two RTTs plus the connection handshake, and selection.rs already named this as "the first term to revisit if distant-region selection looks too sparse". hel1's decdn_probe_collection_latency_seconds for the day: 25 rounds ≤ 0.25 s, 50 ≤ 0.5 s, 156 ≤ 1 s, so 106 of 156 rounds overran the old ceiling. At 1 s the direct-path grace keeps its 500 ms cap with headroom, and the derived outer pull-through deadline at defaults is 168 s (was 167.5 s). ADR 001 § Probe response collection, ADR 005 and the observability appendix carry the figure.

Refs #2366. Not Closes: mechanism A is fixed and B/C are instrumented; the reporter's note stands that verification needs a blob the fleet has not cached.

Commit 3 — review follow-ups

A directory origin the first round skipped (negative-cached or wedged) was counted as skipped again by the origin-directory supplement; probe_round now returns the peers it resolved, and the supplement leaves them out. holders / spans are taken after the requester drop. ADR 001 / ADR 005 / selection.rs state one probe cost model (two RTTs: the connection handshake and the request). The fixture probe responder answers has_blob from its coverage, and a new journey pins the single count.

Not in this PR

Reviewer notes

  • Read PullLegTrail and open_pull_leg in crates/node/src/node_origin/pull_leg.rs first, then ProbeTally / probe_round in node_origin/mod.rs. log_miss_refusal in handlers/client/wire.rs is the only consumer.
  • The buffered Origin::fetch path passes a throwaway tally; its refusal is buffered_miss, not this line.
  • holders counts what the rounds admitted, before the requester drop.
  • A cached walk that falls through to a fresh lookup reports the lookup's source; handshakes counts both walks (documented on the type).

Verification

  • cargo fmt -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items
  • cargo nextest run -p decdn-node --no-fail-fast (1710 passed on the final tree)
  • cargo nextest run -p decdn-cli -p decdn-common -p decdn-client
  • make -C adr check-refs; pre-commit run --files adr/001-network.md adr/005-protocol.md adr/appendix-observability.md CHANGELOG.md
  • New tests: an_unreachable_only_candidate_refuses_with_the_walk_on_the_line (node_origin_pull: a directory that lists only a dead peer refuses on pull_leg_miss with source=directory discovered=1 probed=1 unreachable=1 holders=0 handshakes=0), a_negative_cached_only_candidate_is_skipped_once_per_walk (fails under the double-count mutation), two log_miss_refusal line tests, two ProbeTally unit tests (the arm mapping fails under mutation), probe_timeout_matches_the_adr_collection_ceiling and outer_pull_deadline_at_defaults_is_168s pinned before the constant moved.
  • Fleet: after a redeploy, every pull_leg_miss line in Loki carries the trail; compare decdn_node_pull_unreachable_total per node against today's 31/293 on hel1 and the refusal count against 13/293.
  • User-visible change: CHANGELOG.md entries added
  • Design change: ADR 001 / ADR 005 / appendix-observability updated
  • PR title uses an allowed type and a lowercase subject

🤖 Generated with Claude Code

thiras and others added 2 commits October 18, 2026 22:56
A `serve-miss: refusing the request` line on the `pull_leg_miss` path
said only `cause=clean_miss`. The fleet logs at info, so a refusal
could not say whether discovery named nobody, every candidate was
skipped or unreachable, the holders did not span the blob, or every
handshake failed. The open questions in #2366 are exactly those.

`open_pull_leg` returns a `PullLegMiss { miss, trail }`. The
`PullLegTrail` records where the candidate list came from (`source`:
cache, dht, directory, none), its size (`discovered`), what the probe
rounds saw (`skipped`, `probed`, `unreachable`, `absent`, `dropped`,
`holders`, `spans`) and what the handshake walk did (`handshakes`,
`last_fault`). The refusal line records every field, and every
serve-miss refusal line now carries the request's `namespace_id`.

- `probe_candidate` returns `Result<Candidate, ProbeDrop>`; the round
  tallies each drop under its arm. Side effects are unchanged.
- `discover` returns `Discovered { providers, source }`.
- `handshake_total_bytes` returns a `HandshakeFault { miss, why }`;
  `PullVerdict::as_str` and `PoolOpenArm::as_str` name the fault.
- The buffered `Origin::fetch` path passes a throwaway tally.

Refs #2366

Co-Authored-By: Claude Fable 5.1 <[email protected]>
`PROBE_TIMEOUT` was 500 ms. A probe dials a fresh connection and the
protocol has no 0-RTT path, so every probe costs two RTTs plus the
connection handshake. At inter-continental RTTs that sits at or past
500 ms, so a node whose only candidate was a far origin dropped it as
unreachable and signed `NotFound` for content that origin serves. On
the testnet, 106 of hel1's 156 probe rounds in one day overran the old
ceiling, and each `pull_leg_miss` refusal minute moved
`decdn_node_pull_unreachable_total` by one.

The budget is 1 s. The direct-path grace keeps its 500 ms cap, so it
now has headroom instead of what is left of the exchange. The derived
outer pull-through deadline at defaults is 168 s. ADR 001 § Probe
response collection, ADR 005 and the observability appendix carry the
figure.

Refs #2366

Co-Authored-By: Claude Fable 5.1 <[email protected]>

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.

🟢 Approval recommended

The diagnostic propagation preserves refusal semantics, and the timeout change has consistent deadline arithmetic, regression checks, and documentation.

No open issues 🎉

What changed in this PR

Improves diagnosis of node pull-through refusals for #2366 and gives distant upstream providers more time to answer probes.

Changes:

  • Adds discovery, probe, and handshake details plus the request namespace to refusal logs.
  • Raises the upstream probe timeout to 1 second, making the default outer deadline 168 seconds.
  • Adds regression checks and updates documentation.
File Description
crates/​node/​tests/​node_origin_pull.rs Tests unreachable-provider refusal diagnostics.
crates/​node/​tests/​client_loopback.rs Checks unprovisioned pull-leg diagnostics.
crates/​node/​src/​selection/​tests.rs Pins updated timeout and deadline values.
crates/​node/​src/​selection.rs Raises the probe timeout.
crates/​node/​src/​node_origin/​tests.rs Tests diagnostic tally mapping and saturation.
crates/​node/​src/​node_origin/​pull_leg.rs Carries discovery and handshake diagnostics.
crates/​node/​src/​node_origin/​mod.rs Tracks discovery sources and probe outcomes.
crates/​node/​src/​metrics.rs Updates the histogram documentation.
crates/​node/​src/​handlers/​client/​wire/​tests.rs Tests refusal log fields.
crates/​node/​src/​handlers/​client/​wire.rs Logs namespace and pull-leg diagnostics.
crates/​node/​src/​handlers/​client/​window.rs Propagates detailed pull-leg misses.
crates/​node/​src/​handlers/​client/​mod.rs Updates the refusal-path payload.
crates/​common/​src/​config/​types.rs Documents the revised default deadline.
crates/​common/​src/​config/​mod.rs Updates deadline documentation.
crates/​client/​src/​probe/​tests.rs Updates the timeout reference in a comment.
crates/​cli/​src/​commands/​config.rs Updates generated configuration comments.
CHANGELOG.md Describes diagnostics and timeout changes.
adr/​appendix-observability.md Documents the new probe ceiling.
adr/​005-protocol.md Updates probe timing documentation.
adr/​001-network.md Updates collection timing and latency tradeoffs.

Review effort: Balanced

@github-code-quality

github-code-quality Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main f5d3de6 fix/pull-leg-miss-tr... ce853b2 +/-
76% 76% 0%
View coverage of the 5 most impacted files.
File main f5d3de6 fix/pull-leg-miss-tr... ce853b2 +/-
crates/node/src.../client/wire.rs 93% 90% -3%
crates/node/src...gin/pull_leg.rs 85% 84% -1%
crates/node/src...e_origin/mod.rs 88% 88% 0%
crates/node/src...s/client/mod.rs 91% 91% 0%
crates/cache/src/engine.rs 91% 91% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 18, 2026 20:28 UTC

…equester drop

Review follow-ups for the pull-leg trail.

- `probe_round` returns the peers it resolved (probed or skipped), and
  the origin-directory supplement leaves both out. A directory origin
  the first round skipped as negative-cached or wedged no longer counts
  as `skipped` twice. Behaviour is unchanged: a second round would skip
  it again.
- `holders` and `spans` describe the candidates the handshake walk has,
  after the requester drop. The directory supplement can probe the
  requester, and the walk drops it.
- `PullLegTrail` documents that `skipped` and `probed` include the
  supplement round, that a cancelled probe counts in `probed` only, and
  that a directory list is not negative-cache filtered.
- ADR 001, ADR 005 and the `PROBE_TIMEOUT` doc state one probe cost
  model: two RTTs, one for the connection handshake and one for the
  request. ADR 001 § Probe response collection is split into short
  sentences.
- The fixture probe responder answers `has_blob` from its coverage, so
  a holder with no block answers `has_blob: false` as a node does; the
  empty blob keeps `has_blob: true`.
- One journey: a directory origin that holds nothing is probed once,
  negative-cached, and skipped once on the next serve.

Refs #2366

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@thiras
thiras merged commit f81ab73 into main Oct 18, 2026
31 checks passed
@thiras
thiras deleted the fix/pull-leg-miss-trail-2366 branch October 18, 2026 20:54
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