Repository navigation
feat(cache): retain range-admitted partials across GC (#1607) - #1641
Conversation
admit_bao now gives each partial's raw hash a deterministic idempotent named tag (decdn-partial-<hash>); drop_named_tags_for already removes it on evict. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…l test (#1607) Range pull-through now protects the partial it imports; a control untagged partial is reclaimed on the same sweep, proving GC runs. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Use crate::range_pull::{align_range, encode_verified_range, IROH_BLOCK_SIZE}
and crate::CHUNK_GROUP_BYTES in the new retained-partials test helpers, matching
the rest of engine.rs; note the GC-test sleep must track the GC interval.
Addresses the final-review Minor findings; no behavior change.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Warning Review limit reached
Next review available in: 38 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (1)
WalkthroughPartial blob imports now receive deterministic raw-hash tags through range pull-through and ChangesPartial blob protection
Estimated code review effort: 3 (Moderate) | ~20 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Coverage reportTotal: 80.77% (was 80.74%, ▲ +0.03%) — 59435/73586 lines
History
|
There was a problem hiding this comment.
Pull request overview
This PR ensures range-admitted (partial) blobs are retained across iroh-blobs GC by assigning a deterministic, idempotent named tag (decdn-partial-<hash>) immediately after import_bao_bytes. This supports the cache engine’s ongoing move toward gap-driven serve-miss behavior (Phase B), where already-held ranges must remain durably available between retries/resumes.
Changes:
- Added
CacheEngine::protect_partial(hash)which sets a deterministic named tag pointing at the raw hash to prevent GC reclaim of partials. - Invoked
protect_partialafter partial-range imports in bothpull_through_range’s import path andCacheEngine::admit_bao. - Added tests validating tag idempotence and that tagged partials survive real GC while untagged partials are reclaimed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…review) - pull_through_range doc no longer claims 'does not promote a named tag'; it now documents the decdn-partial-<hash> GC-protection tag while keeping the has()- false / not-DHT-advertised facts. - GC-survival test polls for the control's reclaim (15s budget) instead of a fixed 1500ms sleep: fails fast, robust on slow CI, independent of the GC interval; the control's NotFound still gates the test. Co-Authored-By: Claude Opus 4.8 <[email protected]>
What
#1607 (B0 of the #1621 Phase B node serve-miss). Range-admitted (partial) blobs now get a deterministic, idempotent protecting named tag on first
import_bao_bytes, so iroh-blobs GC no longer reclaims held ranges. This is the prerequisite for the node's gap-driven serve-miss to durably skip ranges it already holds.CacheEngine::admit_baoand thepull_through_rangerange import call a newprotect_partial(hash)→tags().set("decdn-partial-<hash>", raw(hash)).setoverwrites by name → exactly one tag per partial, no proliferation.drop_named_tags_for(evict) already removes it by hash — teardown composes.Spike that justified this
iroh-blobs 0.103 GC marks a RAW root
liveunconditionally (no completeness check) and sweeps only non-live hashes, so a named tag protects a partial — confirmed empirically against a realFsStoreGC loop.Verification
admit_bao_tags_the_partial— a partial admit creates exactly one tag; a second (different) range admit keeps it at one (idempotent).tagged_partial_survives_gc_untagged_is_reclaimed— a tagged partial survives real GC sweeps; an untagged, different-hash control is reclaimed on the same sweep (proves GC ran).cargo build && cargo clippy --all-targets -- -D warnings,cargo nextest run(2824/2824),cargo fmt -- --check, and thedecdn-e2e --features anvil-e2ecompile gate — all green.Not in this PR
B1 (
ServeStoretrait), B2 (route serve-miss throughdrive()+WindowPacer), B3 (multi-observer coalescing) — the rest of Phase B.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests