Repository navigation
fix(node): own origin streams blobs past max_blob_size without storing the rest - #2937
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 6 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
|
I don't think The gap this PR fixes is real.
Suggestion: keep the limit on held bytes, but treat it as a cache limit on own origin, not a reason to refuse. When an own-origin range would push held bytes past the cap, stream it from the backend to the requester, verified against the outboard, without storing it, instead of stopping with This probably needs a non-holding store, or a separate streaming leg, for Generated by Claude Code |
Commit ddafe97: own origin serves blobs past
|
Agreed. ddafe97 does what you suggest:
The commit also makes the cap strict:
The details are in the commit comment above. |
Gas snapshotNo gas changes vs base. |
Commit 5962d33: review fixes for origin pass-throughThis commit fixes what a three-part review of ddafe97 found (correctness, test coverage, and error handling with doc accuracy). The review found no problems with the reservation ordering, deadlocks, Fixes
New tests
Mutation checks: restoring the old Verification: Not covered by a test: a mid-stream takedown on an own-origin serve at the cap, and a store fault that must not fall back to pass-through. Both need fault injection that the harness doesn't have. |
There was a problem hiding this comment.
🟡 Changes recommended
Active pass-through defects can falsely fault healthy origins, fetch beyond requested ranges, and overcharge shared outboard memory, causing unnecessary egress and stalled serves.
4 open issues
1 resolved since last review
Review effort: Balanced
…g the rest max_blob_size bounds the bytes of one blob a node holds. An own-origin blob larger than the cap gets an exclusive fill: it stores the blob up to the cap, then verifies each further chunk group against H and hands it to the serve leg in memory without storing it. The serve never refuses, so every origin object stays servable, and one large blob cannot evict many small ones. Pull-through keeps its Declined at the cap. - decdn-cache: AdmitControl::store_budget routes leaves past the budget to FillSession::pass_leaf; CacheStore counts handed-over ranges as landed for an exclusive session; FillRegistry::claim_exclusive registers an owner no claim attaches to. - serve reader takes handed-over leaves from its session. - metrics: decdn_serve_origin_passthrough_streams_total and _bytes_total, plus an info! line per pass-through stream. - ADR 005, 037 and the observability appendix describe the behavior. Closes #2934. Co-Authored-By: Claude Opus 5.5 <[email protected]>
9e3ee19 to
2e13337
Compare
…he-passthrough-fcc7a0 # Conflicts: # crates/cache/src/engine.rs

What
max_blob_sizemeans one thing on every path: the bytes of one blob a node keeps.H, then handed to the serve leg in memory and not stored. No refusal, no mid-streamDeclined.Declined, because it pays its upstream for every byte.Closes #2934.
Why
#2934 found an own-origin blob over the cap answered
NotFound. In practice main served such a blob and kept all of it, since the own-origin fill never checked the cap. Declining it instead would make the largest objects in an origin unservable, and tie the reach of a blob to whichever origin node has the biggest cap: if that node dies, the blob is gone. Keeping it all lets one large blob evict many small ones. Passing the excess through keeps every origin object servable and holds the cap on disk.How
decdn-cache:AdmitControl::store_budget: the admit stores leaves while they fit, and hands every later verified leaf to the fill session (FillSession::pass_leaf) with its proof nodes dropped from the store. The session already captured those nodes for the serve's outboard.CacheStorewith an exclusive session sets the budget fromCacheEngine::held_roomat each leg and counts handed-over ranges as present, so the pull does not fetch them again.is_completestill reads the real store, so nothing finalizes early.FillRegistry::claim_exclusiveregisters an owner that attaches to no live fill, andclaimnever attaches to an exclusive fill: each handed-over leaf goes to exactly one serve leg.AwaitingDataReadertakes handed-over leaves from its session, and wakes on each hand-over.serve_via_backend_originclaims an exclusive fill whenCacheEngine::exceeds_held_cap(total_bytes).decdn_serve_origin_passthrough_streams_total,decdn_serve_origin_passthrough_bytes_total, and oneinfo!line per pass-through stream naming the blob size and the bytes passed through.max_blob_sizeenforcement, theDeclinedrow, discovery), 037 (origin tier), the observability appendix. Config docs updated.Reviewer notes
PULL_AHEAD_BYTESpast the paid frontier, so only a few handed-over chunk groups wait in memory.Verification
cargo nextest run -p decdn-cache: 493 passed.-p decdn-node --lib --test origin_range_pull: 1258 passed. A full five-crate run (node, cache, client, common, cli) before the final claim-path change: 5027 passed, twonode_origin_pulltests passed on retry.--all-targets --all-features), fmt,cargo docwith warnings denied, andmake -C adr check-refsare clean. Hooks ran on the commit.🤖 Generated with Claude Code