Repository navigation
fix(evict): heal index after out-of-band deletes + add richer monitoring metrics - #65
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
+ Coverage 96.97% 97.12% +0.14%
==========================================
Files 6 6
Lines 2218 2333 +115
==========================================
+ Hits 2151 2266 +115
Misses 67 67 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The cache-size gauges come from an in-memory index that assumes the proxy owns the cache dir, so a mirror deleted by hand left them stale until restart. The eviction task now reconciles the index against disk on a timer, dropping entries whose path has vanished and refreshing the gauges. Closes #59. Assisted-by: Claude:claude-opus-4-8
Document that the cache is self-managing and that `--cache-max-mb` is the intended way to reclaim disk, since manual mirror deletion is tolerated but not the supported lever (see #59). Assisted-by: Claude:claude-opus-4-8
rolandjitsu
force-pushed
the
fix/self-healing-cache-index
branch
from
October 31, 2026 07:12
4eab554 to
04f7ca0
Compare
Expose the configured cache cap (cache_max_bytes) and fetch TTL (fetch_ttl_seconds) as static gauges set at startup, so a dashboard can compute cache utilization without hardcoding the cap (see #57). Assisted-by: Claude:claude-opus-4-8
Add cache_outcome_total{outcome=cloned|fetched|cached}, recorded once
per info/refs advertisement where the clone/fetch/TTL decision is made.
It is the local-vs-upstream signal: the share served without touching
upstream is cached / sum without (outcome) (...). The outcome was
already computed by ensure_fresh and discarded; this wires it up.
Closes #57.
Assisted-by: Claude:claude-opus-4-8
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 kind of change does this PR introduce?
Summary
The cache-size gauges come from an in-memory index that assumes the proxy owns the cache dir, so a mirror deleted by hand left them stale until restart - see #59. The eviction task now reconciles the index against disk on a timer, dropping entries whose path has vanished and refreshing the gauges.
Also, address pt. 2 and 3 from #57.
Tests
Checklist
cargo fmt --all --check,cargo clippy --all-targets --all-features --locked -- -D warnings,cargo test --all-featuresAssisted-by:trailer (see CONTRIBUTING.md / AGENTS.md)Breaking change?
No.