Repository navigation
feat(config): default max_blob_size_mb to cache_size_mb, keep the knob (#1685) - #1686
Merged
Merged
Conversation
#1685) The 1 GiB `DEFAULT_MAX_BLOB_SIZE_MB` was a memory-era number from when the warm/buyer leg buffered a whole blob in RAM. On defaults it refused a blob a node's disk could easily hold. Unset, `cache.max_blob_size_mb` now resolves to `cache_size_mb` — the disk budget is the admission ceiling and a node admits any blob it can store. The knob stays node-configurable for operators who want a tighter per-blob bound. The load-time invariant relaxes from `< cache_size_mb` to `<=` so the default (equality) is legal; a value above `cache_size_mb` is still rejected and `0` still means unlimited. Every serve/buyer gate and the wire meaning of `BlobTooLarge` are unchanged. This is the smaller alternative to removing the knob (#1678); the buffered miss tier's RAM buffer is ported separately in #1682. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This was referenced Aug 14, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the deCDN node cache configuration so that cache.max_blob_size_mb no longer defaults to a fixed 1 GiB. Instead, when unset it resolves to cache.cache_size_mb, making the cache’s disk budget the default per-blob admission ceiling while keeping the operator-configurable knob intact.
Changes:
- Remove the fixed
DEFAULT_MAX_BLOB_SIZE_MBdefault and resolve unsetmax_blob_size_mbtocache_size_mb. - Relax config-load validation from
max_blob_size_mb < cache_size_mbto<=(equality becomes valid/default). - Update the CLI config template comment and add a CHANGELOG entry; adjust/extend tests accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/common/src/config/mod.rs | Drops the fixed max-blob default, defaults unset to cache_size_mb, relaxes invariant to <=, updates error text and tests. |
| crates/cli/src/commands/config.rs | Updates the generated config template comment to reflect the new default/invariant. |
| CHANGELOG.md | Documents the new default behavior and the invariant change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage reportTotal: 80.79% (was 80.79%, ● 0.00%) — 59399/73521 lines
History
|
The Disk full section claimed no cache-capacity metric is exported and that raising cache.cache_size_mb is a no-op. Both are wrong since the #1173 eviction driver: cache_size_mb is enforced (LRU release + iroh-blobs GC reclaim), and decdn_cache_bytes / decdn_cache_size_limit_bytes gauges track footprint against the ceiling. This PR makes cache_size_mb the admission default too, so the correction is worth landing alongside it. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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 #1685.
What changed
cache.max_blob_size_mbkept a fixed 1 GiB default (DEFAULT_MAX_BLOB_SIZE_MB) —a memory-era number from when the warm/buyer leg buffered a whole blob in RAM.
On defaults it refused a blob a node's disk could easily hold.
Unset,
max_blob_size_mbnow resolves tocache_size_mb: the disk budget isthe admission ceiling, and a node admits any blob it can store. Nothing else
moves — the knob stays node-configurable (CLI
--max-blob-size-mb, envDECDN_MAX_BLOB_SIZE_MB,[cache]file), every serve/buyer gate stays, and thewire meaning of
BlobTooLargeis untouched.The one forced consequence: the load-time invariant relaxes from
max_blob_size_mb < cache_size_mbto<=, so the default (equality) is legal.A value above
cache_size_mbis still rejected — a blob larger than thewhole cache can never be admitted — and
0still means unlimited (it passes0 <= cache_size_mb).This is the small alternative to removing the knob (#1678, PR #1683 — both
closed). No gate removal, no wire-semantics rework, no
0-sentinel churn.Known interaction (tracked, not fixed here)
node_origin::resume::pull_blobstill buffers the whole blob intoLoopState.buf: Vec<u8>, bounded bymax_blob_size_bytes. Raising the defaultceiling to
cache_size_mbraises that one tier's worst-case RAM to the diskbudget until the buffer is ported to streaming — that port is #1682, which
stays open and is the real fix.
Also in this PR: runbook correction
The "Disk full" section of
docs/runbook.mdclaimed no cache-capacity metric isexported and that raising
cache.cache_size_mbis a no-op. Both are stale sincethe #1173 eviction driver —
cache_size_mbis enforced (LRU release +iroh-blobs GC reclaim), and
decdn_cache_bytes/decdn_cache_size_limit_bytesgauges track footprint against the ceiling. This PR makes
cache_size_mbtheadmission default too, so the correction lands alongside it.
Diff
crates/common/src/config/mod.rs— dropDEFAULT_MAX_BLOB_SIZE_MB; unset ⇒cache_size_mb; invariant<→<=; doc + tests.crates/cli/src/commands/config.rs— template comment.docs/runbook.md— correct the stalecache_size_mb-unenforced claims.CHANGELOG.md— config entry.Verification
cargo nextest run -p decdn-common -p decdn-cli— 853 passed, 0 failedcargo clippy -p decdn-common -p decdn-cli --all-targets— cleancargo fmt -- --check— clean🤖 Generated with Claude Code