Repository navigation
Conversation
…sion (#1678) `cache.max_blob_size_mb` existed to bound RAM, back when the warm/buyer leg buffered a whole blob. Since the range-aware `admit` path (#1607/#1608) that leg streams to disk at O(chunk-group), so the cap only stopped a node from holding a blob its disk could easily fit — a 1 GiB default sized for memory refusing a 2 GB blob on a node with 2 TB of disk. The knob, its CLI flag/env, and the `max_blob_size_mb < cache_size_mb` invariant are gone. `cache.cache_size_mb` is now both the disk budget and the admission ceiling, and gains a non-zero floor: it became load-bearing, and the engine's cap has no "unlimited" sentinel, so a zero budget would refuse every blob rather than disable the check. Admission, not delivery. A resident blob is always served — the old serve-side gate burned the storage cost and then declined the revenue for it. The engine's cap is kept and retargeted, because it guards the one ingest path with no signed size ahead of the bytes: an origin backend can misstate or omit its length, where a paid provider commits to `total_bytes` up front. `resume::pull_blob` is the exception and keeps a ceiling, in memory rather than disk. It is the last ingest path holding a whole blob in RAM, so it is bounded by `cache.origin_retry.buffered_max_bytes` — sizing it off a 10 GiB disk budget would be a category error. Blobs above it fall to the streaming window tier; porting that loop off the buffer is #1682. No admission reservation ships here. Eviction remains the sole enforcer, and this adds the instrumentation to find out whether that is enough: `decdn_cache_pending_reclaim_bytes` (reclaim lag — already tracked in `DriverState`, never exported), `decdn_cache_evicting`, `decdn_cache_fill_in_flight_bytes`, and a `decdn_node_fill_size_*` ladder. #1681 is pre-written for if they show bursts outrunning reclaim; making GC on-demand, which would close the lag directly, stays blocked upstream (#520). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Coverage reportTotal: 80.82% (was 80.83%, ▼ 0.01%) — 59599/73745 lines
History
|
The knob removal shipped alongside ~300 lines of cache observability (`decdn_cache_pending_reclaim_bytes`, `decdn_cache_evicting`, `decdn_cache_fill_in_flight_bytes`, the `decdn_node_fill_size_*` ladder, and `FillRegistry::total_in_flight_bytes` behind them). None of it is about `max_blob_size_mb`. It was added as the alternative to building an admission reservation — instrumentation to decide #1681 later — which is a separate concern from deleting the knob. `advance_latch` goes with it. It would still be used after the gauges are removed, so it is not dangling, but it was extracted out of `tick` solely to make the `evicting` gauge testable: a refactor that exists only to serve the metrics goes when the metrics go. `crates/cache/src/metrics.rs`, `crates/cache/src/fill_session.rs`, `crates/node/src/runtime/eviction.rs`, and `adr/appendix-observability.md` are now byte-identical to main. The `FillOutcome` classification split stays. It is justified by `FillOutcome::TooLarge` — a knob-removal change — not by the metrics; removing it would mean re-adding `#[allow(clippy::cognitive_complexity)]` to both fill functions. The admission model is unchanged and is what the docs now describe: a blob is admitted if it fits `cache_size_mb`, and eviction reconciles the rest. #1681 is closed as won't-do — with the metrics gone there is no evidence path left to decide it. #1682 (port `resume::pull_blob` off its in-memory buffer) is unaffected. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The paragraph restated what the section above it already establishes — the line under the risk table, and the `Credit Window` section that follows, both cover how far a pool may be drawn before nodes stop serving it. Saying it a third time in the voucher-interval discussion added no constraint. The replaced sentence's actual job is done by what remains: interval negotiation carries per-voucher overhead, and blob size is not a payment-side bound at all.
This was referenced Aug 14, 2026
Contributor
|
Superseded by #1686 (closes #1685). Rather than remove |
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.
Closes #1678.
What changed
cache.max_blob_size_mbexisted to bound RAM, back when the warm/buyer leg buffered a whole blob. Since the range-awareadmitpath (#1607/#1608) that leg streams to disk atO(chunk-group), so the cap only stopped a node from holding a blob its disk could easily fit — a 1 GiB default sized for memory refusing a 2 GB blob on a node with 2 TB of disk.The knob is gone, along with its CLI flag/env (
--max-blob-size-mb/DECDN_MAX_BLOB_SIZE_MB), themax_blob_size_mb < cache_size_mbstartup invariant, and the serve-side and buyer-sideBlobTooLargegates.cache.cache_size_mbis now both the disk budget and the admission ceiling.Admission, not delivery
A resident blob is always served. The old serve-side gate refused blobs already in the store, which burned the storage cost and then declined the revenue for it.
StreamError::BlobTooLargesurvives with a narrower meaning: "I could not take this in", never "I have it but will not send it".The cache engine keeps its cap, retargeted to
cache_size_mb. It guards the one ingest path with no signed size ahead of the bytes — an origin backend can misstate or omit its length, where a paid provider commits tototal_bytesup front and the body streams to disk.The admission model is deliberately simple: a blob is admitted if it fits
cache_size_mb; the eviction driver reconciles the rest. Nothing reserves disk before a fill starts, so a burst of concurrent fills can overshoot the budget until the driver catches up — documented inadr/appendix-blob-cache-eviction.md. An up-front reservation was considered and dropped (#1681, closed won't-do).Two things reviewers should look at
1.
cache_size_mb = 0is now rejected at startup. The budget became load-bearing, and the engine cap has no "unlimited" sentinel — a zero budget is a 0-byte cap that refuses every blob, the opposite of what0reads as to an operator.2. The buffered miss tier keeps a ceiling, in memory rather than disk.
resume::pull_blobstill accumulates the whole blob intoLoopState.buf— it is the lastO(blob)ingest path, andmax_blob_size_mbwas its only bound (asCHANGELOG.mdand ADR 037 already recorded). Sizing it off a 10 GiB disk budget would be a category error, so it is bounded bycache.origin_retry.buffered_max_bytes(4 MiB default) instead. Blobs above that fall to the streaming window tier — a live behaviour change on that tier. Porting the loop off the buffer is #1682.Commits
5cb8def8— the knob removal itself.e8dc161a— removes ~300 lines of cache observability the first commit carried (decdn_cache_pending_reclaim_bytes,decdn_cache_evicting,decdn_cache_fill_in_flight_bytes, thedecdn_node_fill_size_*ladder, and theadvance_latchextraction behind them). It was added as the alternative to building an admission reservation, which is a separate concern from deleting the knob.crates/cache/src/metrics.rs,crates/cache/src/fill_session.rs,crates/node/src/runtime/eviction.rs, andadr/appendix-observability.mdare byte-identical to main as a result.f5067538— drops a redundant paragraph from ADR 003. The section already states the worst-case exposure is small against the reserveM, and theCredit Windowsection below covers pool drawdown; a third restatement added no constraint.Reviewing commit-by-commit is the easier read — 2 and 3 are pure deletions.
Kept deliberately: the
FillOutcomeclassification split (for_cache_error/is_reportable_fill_error/classify_fill_error). It is justified byFillOutcome::TooLarge, a knob-removal change, not by the metrics — removing it would mean re-adding#[allow(clippy::cognitive_complexity)]to both fill functions.Also worth noting
FillOutcome::TooLargeis new. Without it the engine refusal would have degraded to a wireNotFound, sending clients to re-pay elsewhere with no signal;BlobTooLargeis what ADR 005 §Retry behavior defines as "do not retry this node, a different node may accept it".decdn fetch --max-blob-mbis unaffected, but now enforced in the CLI rather than in the requester — the CLI is the layer that owns the user disk.Verification
cargo nextest run --workspace— 2776 passed, 0 failedcargo clippy --workspace --all-targets -- -D warnings— clean (CI-exact)cargo fmt -- --check,cargo doc --no-deps— cleanDocs updated: ADR 002 (no protocol size limit), ADR 003 (voucher-interval negotiation), ADR 005 (
BlobTooLargeenforcement, probe interaction, retry semantics), ADR 037 (deposit-guard prose),appendix-blob-cache-eviction.md,docs/runbook.md, config template, CHANGELOG. Several of those carried stale claims thatcache_size_mbwas unenforced — untrue since the #1173 eviction driver.🤖 Generated with Claude Code