Repository navigation
fix(cache,node): close the two-leg spine residuals from the #2064 review - #2162
Merged
Merged
Conversation
- Encode-task panic: the range-wire encode catches its own unwind and parks
a CacheError::Store carrying the panic message; UnfinishedGuard now covers
cancel only. The own-origin pull leg logs a Store fault in the chain as an
internal fault (error!), not as a local-origin fault.
- Observability: decdn_cache_range_pull_permit_waits_total counts draws that
find the range-pull pool full, with a warning past 10 s; the pacer hook
records decdn_node_pull_through_wait_seconds per pause and warns once past
30 s. Registry rows and dashboard targets added.
- No-Range origin: origin_range_serviceable probes the first chunk group
before the node signs, so an origin that publishes {H}.obao4 but declines
Range degrades to the buffered whole-blob pull. A per-origin latch makes
the probe free once an origin has served a clean range window.
- Refused attach: an already-present overlap is never re-fetched (the owner's
gaps come from missing_ranges), so no smarter attach rule helps without
reintroducing starvation. fill_not_coalesced now counts once per claim and
only when the skipped fill overlaps the request.
Closes #2069
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit b7f25b3 in the Show a line coverage summary of the most impacted files.
Updated |
…ne-residuals # Conflicts: # CHANGELOG.md
- Add CacheError::Internal for code bugs (caught encode panic, broken reader invariant, closed permit pool). The own-origin pull leg flags only Internal as a code bug; a store fault such as a full disk stays Store. - Key the range-probe latch on the origin that served the outboard, not on the outboard cache, which never holds an empty outboard (blobs of one chunk group) or one over 256 MiB. The probe hands that outboard to the cursor, so it no longer reads an uncacheable outboard twice. - A wrong-length first window advances the origin chain instead of shadowing a healthy later origin. - Record a pull pause's length from a drop guard, so a cancelled pause is observed too; log full error chains; debug-log a range decline. - Tests: small-blob latch, range-declining and short-first-window origins ahead of a healthy one, permit wait past the warning, a range-probe timeout refusing InternalError, and the degrade test tied to the probe. - Docs: ADR 037 serviceability and fallback conditions, stale comments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Addressed the review findings in b7f25b3:
Gate: clippy Note: the HTTP adapter maps any non-206 ranged answer (a 500 included) to a clean decline, so an HTTP 5xx on the probe degrades rather than latching |
thiras
approved these changes
Sep 26, 2026
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.
What
Closes the four residuals the #2064 review collected in #2069.
OriginRangeWire::spawncatches the encode's unwind (catch_unwind, writer kept outside so the channel still closes only after the verdict is parked) and parks the newCacheError::Internalcarrying the panic message (also used for a broken reader invariant and a closed permit pool).UnfinishedGuardcovers cancel. The own-origin pull leg logs anInternalfault in the error chain aterror!as a code bug; aStorefault (e.g. disk full) keeps the local-origin warning.decdn_cache_range_pull_permit_waits_totalcounts draws that find theMAX_CONCURRENT_RANGE_PULLSpool full; a wait past 10 s logs one warning.decdn_node_pull_through_wait_secondsrecords the length of each pacer pause (window full or min draw) inDownstreamWait; a pause past 30 s logs one warning. The client crate is unchanged (PacingWaitis the seam).adr/appendix-observability.md; dashboard targets inmonitoring/dashboard-delivery.json.Rangeorigin degrades before signing. NewCacheEngine::origin_range_serviceablereplacesorigin_fetch_outboard_bytesin dispatch: outboard present AND a ranged read of the first chunk group succeeds.falsefalls through to the buffered whole-blob populate (ADR 037 fallback),Errhits the Reactive pull-through: a hard origin/store fault terminates as a signed CacheMiss (NotFound), not InternalError — both tiers #1129 fault latch. A per-originorigin_range_confirmedlatch, keyed on the origin that served the outboard (set by any clean first window, probe or draw), makes the range read free after the first success. A wrong-length first window advances the origin chain. The origin-walk loop is factored out oforigin_range_wireintoopen_range_cursor, shared by both.store.missing_rangesat start, so an already-present overlap is never re-fetched. The only duplicate is overlap not yet in the store, which is exactly where attaching starves. The rule stays;fill_not_coalescednow counts once per claim and only when the skipped session's covered range overlaps the request (previously per skipped session, disjoint ones included).Closes #2069
Reviewer notes
crates/cache/src/engine.rs(origin_range_serviceable,open_range_cursor,range_pull_permit), thencrates/cache/src/origin_range.rs(spawn,park_panic).partial_serveshows this).origin_range_pull.rsand one inpartial_serve.rsmocked only the exactRangeheader of the draw, so the probe GET 404'd and the node degraded. They now mount the probe viamount_range_probe, and GET counts exclude the probe header.no_range_origin_after_outboard_success_fails_cleanly(which pinned the old sign-then-fail behavior) is replaced byno_range_origin_degrades_to_buffered_before_signing.Rangefails a draw like any mid-life origin fault (documented on the field).tokio::time::Instantso the paused-clock test measures the real pause.Verification
cargo fmt -- --checkcargo clippy --workspace --all-targets -- -D warnings— cleancargo nextest run -p decdn-cache -p decdn-node --no-fail-fast— 1777 passedcargo nextest run -p decdn-cli -p decdn-client— 1214 passedRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items— cleancontracts/changed — n/aCHANGELOG.mdentry addedadr/appendix-observability.mdregistry rows added/updated🤖 Generated with Claude Code