Repository navigation
Description
Deferred from the #1510 review as feature scope rather than a fix.
PrewarmReport.failed (and the counter behind it) merges three situations with different operator remedies:
- The origin does not hold the pinned hash — wrong
cache.pinned_hashes, or a wrong bucket/prefix. Surfaces asCacheError::NotFound. - The origin is unreachable, or its circuit breaker is open — an availability problem, nothing wrong with the config.
- A local store error on the presence check — a node-side fault.
The original metric doc asserted that failed == pin-set size "almost always means cache.pinned_hashes names content the configured origin does not have". An unreachable origin produces the identical number, and in ops terms it is the more common cause. #1510 corrected the doc to say the counter does not diagnose on its own and to point at the per-hash warn lines — but the per-hash logs are the wrong granularity for an alert.
CacheError::NotFound already distinguishes case 1 at zero cost, so the split is roughly:
PrewarmOutcome::Failedgains a discriminator (e.g.Failed { at_origin: bool }, or split intoNotAtOrigin/Errored), set by matching the error atcrates/cache/src/engine.rsinprewarm_one.PrewarmReport.failedsplits into two counts; the partition identity in its doc extends to five bins.- One new sibling counter (
decdn_cache_prewarm_not_at_origin_total), per the metrics: decide whether the remaining reason-splits follow probe-hold onto {reason} labels #1475 convention. - Appendix row + the assertions in
crates/cache/tests/prewarm.rs, whereprewarm_counts_a_pin_the_origin_does_not_have_as_a_failurealready constructs exactly case 1 and would become the test for the new bin.
Worth doing because it turns an "look at the logs" counter into one an operator can alert on: sustained case 1 is a config error that will never self-heal, while case 2 is transient and should not page.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
github-actions commentedon Jul 29, 2026
🎯 Triage report
Deferred from #1510, this asks to split
decdn_cache_prewarm_failures_total(and the backingPrewarmReport.failedfield) into two distinct bins —not_at_origin(case 1: config/content mismatch) vserrored(cases 2+3: transient availability or local store faults). The motivation is sound: the current single counter is ambiguous between a "will never self-heal" config error and a transient origin outage, making it impossible to write a meaningful alert. The issue is well-scoped: it names the exact enum variant (PrewarmOutcome::Failed), the source file (crates/cache/src/engine.rs), the new counter name, and the existing test that already constructs the case 1 scenario.📊 Assessment
enhancement,technical,rustenhancement+technical; addingrustfor Rust implementation scope💡 Notes and suggestions
Suggested sub-tasks:
PrewarmOutcome::Failedincrates/cache/src/engine.rs— e.g.Failed { at_origin: bool }or split intoNotAtOrigin/Erroredvariants; set it by matchingCacheError::NotFoundinprewarm_one.PrewarmReport.failedinto two counts (not_at_origin+errored); update the five-bin partition identity in the doc comment.decdn_cache_prewarm_not_at_origin_totalcounter following the metrics: decide whether the remaining reason-splits follow probe-hold onto {reason} labels #1475 naming convention; update the appendix observability row.crates/cache/tests/prewarm.rs: rename or extendprewarm_counts_a_pin_the_origin_does_not_have_as_a_failureto assert the newnot_at_originbin; add a companion test for theerroredpath.Implementation note:
CacheError::NotFoundis already available at theprewarm_onecall site, so the discriminator can be set at zero extra I/O cost. The split should be exhaustive — ensure the match arm covers allCacheErrorvariants so future variants don't silently fall into the wrong bin.Add this agentic workflow to your repo
To install this agentic workflow, run
feat(cache): opt-in remote-origin prewarm, settle two deferred decisi…
alpergundogdu commentedon Jul 30, 2026
We're removing the prewarm, origins should be able to return probe responses with { has_blob: true } as long as they have access to the origin and the files "exist" there, and stream and store simultaneously. That removes the need to pull data that's not paid for.