Repository navigation
Closed
Labels
kind:bugSomething does not behave as documented
Description
Summary
A node's whole-blob header handshake against a partial holder makes that holder start a full upstream miss pull, and the caller then abandons it.
- Caller side. When the probe gives no predicted first leg, the pull leg opens
(byte_offset 0, byte_len 0)to read the signedtotal_bytes, then aborts (crates/node/src/node_origin/pull_leg.rs:769-803). - Holder side. A partial holder cannot cover a whole-blob span, so the partial-serve gate (
crates/node/src/handlers/client/dispatch.rs:736) falls through to the miss path. The holder runs a DHT lookup and opens an upstream pull before it answers.
Costs of each handshake:
- about 1–1.5 s of dead time before the caller's real
serve_miss_pullstarts, the same gap two-leg proxy-warming miss still serves ~1.8 MB/s per stream after #2176 #2205 measured; - one wasted upstream open from the holder to the origin holder, which hits the seller's per-signer admission;
- a failed stream on both upstream nodes (
node_pull_through_client_abandoned,serve_stream_client_declined), which pollutes the failure counters and alerts.
Evidence (testnet, 2026-09-28, fleet on 8886c85c)
Entry 7cbb4846… (13.5 GiB consolidated.safetensors). bcl holds it whole; hel1 advertises it as a partial holder.
- 10:07 UTC. lon1 serves a client range and opens a handshake to hel1 before each ~1 MiB sub-pull. hel1's
serve_stream(trace699409d1d4b2b00e0e0cf8f7a91894a7) runsbyte_offset=0 byte_len=0frompeer=lon1. Then it runsdht_lookupfor 945 ms, thenopen_progressive_pullto bcl forbyte_len=1097728. lon1 drops it at +2.2 s withclient-abandoned. That happened 20 times in 5 min. It accounts for all 20 of hel1'sstreams_failed, 18 of its 20node_pull_attemptsfailing, and 19 of bcl'sclient_declinedin the window. - lon1 side (trace
25b99fa1928371c8be9dd767f3f3ac89). The handshakeopen_progressive_pullto hel1 takes 996 ms, and only then doesserve_miss_pullstart its real legs to bcl. - 11:15:42 UTC. Right after a lon1 restart, the same pattern repeated 8 times within 2 s (hel1 traces
b4f3238f…,623db575…,3a39bdee…and others). bcl logged a failed head stream to hel1 (proof 1 … connection lost, tracecf29062b…).
Options
- Skip the handshake when the probe already signed
total_bytes. The probe reply carries it (decdn probeshowstotal_bytesfor hel1). This needs no protocol change. - Handshake on a range the candidate advertises as held. The candidate's
coverageis already known, so the open is a partial hit on the holder. - Let the holder answer a header-only request from its metadata without starting a fill. This changes the protocol, so it needs an ADR.
Option 1 or 2 fixes the caller without touching the wire.
Metadata
Metadata
Assignees
Labels
kind:bugSomething does not behave as documented
Type
Fields
Priority
None yet
Projects
- StatusShow more project fieldsDone
Activity
thiras commentedon Sep 28, 2026
Recurred on 2026-09-28 during a mistral bundle pull (client on
ece78970, fleet on8886c85c). This time fra1 was the caller.byte_offset=0 byte_len=0to hel1 (for example, traced6646fc4804efb29f0cc8686aa352487at 12:28:36, 1.88 s). hel1 then opens its ownbyte_len=1097728head pull to bcl and drops it.f191875a…,95560c57…,6662209e…,b6e2f986…,5504394a…,7b8a4494…and8172dab8…. Each ends 0.5–1 s in withproof 1 of at most 8 for a 1048576-byte chunk (1048576 bytes owed, 0 more queued): proof stream read failed: connection lost. Tempo keeps ~25 % of spans (tempo holds ~25% of serve_stream spans, and the loss is silent #2210), so the real count is probably around 4× higher.Another cost, not listed above: the origin holder sends up to 1 MiB of unpaid data per handshake. "1048576 bytes owed" means bcl had committed a chunk to the leg and was waiting for its proof, which never arrived. Option 1 or 2 removes that too.
thiras commentedon Sep 28, 2026
The CLI sends the same whole-blob handshake, and the handshakes nest across partial holders. Seen 2026-09-28 (CLI
ece78970, client NodeId5e55d0…):bundle pull: multi-source fetch of an entry failed (all sources failed; 2734861280 bytes unfetched); falling back to single-source failoverforb32596…. The fallback's first open isbyte_offset=0 byte_len=0to fra1, which holds only part of that blob.ef5db5928dd3b34bb6457f94b01859ba:dht_lookup314 ms;(0, 0)handshake to hel1, another partial holder, 1.6 s;upstream_streamto bcl.closed by peer: upstream-pull-dropped.9850675a2922a0b5884f53c40470eff5, 4.5 s).One header read from a CLI therefore costs ~5 s and two wasted fills: a CLI→fra1→hel1 chain, before any byte moves. Option 1 (use the probe's signed
total_bytes) should cover the CLI'sDownloaderhandshake too.refactor(client,cli): take the first size claim from the probe hint (#…
refactor(client,cli,node): one acquire loop for fetch recovery, size …
alpergundogdu commentedon Sep 30, 2026
Fixed on both sides of the handshake:
decdn fetchtakes its first size claim from the probe hint. It makes no whole-blob header-only open when a hint exists, and it opens for the header only for a pinned--node-idor the peer-store fast path. The size is a hint that a verified final chunk proves, so the handshake no longer has to be exact.Together these remove the wasted upstream pull the handshake used to trigger on partial holders.