pub enum ProbeHoldOutcome {
Held,
Unavailable,
BudgetExhausted,
HoldsDisabled,
}Expand description
Outcome of crate::CacheEngine::try_probe_hold, carrying two independent
facts (ADR 005 §Probe-triggered eviction hold):
- whether to advertise the blob —
ProbeHoldOutcome::advertises; - whether a hold was actually placed —
ProbeHoldOutcome::hold_placed.
Holds are best-effort, so these are two independent bits:
Self::BudgetExhausted advertises without holding. Use the two
predicates rather than matching on variants, so the mapping stays in one
place; the variants themselves exist so the probe handler can emit the right
metric without a second cache lookup.
Variants§
Held
Blob present (and not operator-evicted) and an eviction hold was
placed, so the blob stays resident for the follow-up pull — sign
has_blob: true.
Blob absent or operator-evicted — sign has_blob: false. Not a
degradation: the node simply does not have the content.
Deliberately the one outcome with no metric. The
probe_hold_unavailable counter records hold refusals for content the
node has; a true negative is not a refusal, and counting it would swamp
the signal every alert on that metric depends on. Despite the shared
word, this is not ProbeHoldUnavailableReason — that enum’s values all
mean “we have it but would not hold it”.
BudgetExhausted
Blob present but all hold slots are in use (max_probe_holds > 0
and the live-hold count has reached it). The caller still advertises
has_blob: true but places no hold, so the blob may be LRU-evicted
before the pull — costing one wasted round trip, never a slash. Counted
as probe_hold_unavailable{reason="exhausted"} (ADR 005 §Hold budget);
the operator-actionable remedy for the lost holds is to raise
max_probe_holds.
HoldsDisabled
Blob present but the eviction-hold path is disabled by config
(max_probe_holds == 0) — the operator opt-out from advertising
store-backed content, so the caller signs has_blob: false.
Operationally distinct from Self::BudgetExhausted (#739): a
deliberate choice, not load. Counted as
probe_hold_unavailable{reason="disabled"}, never as
{reason="exhausted"} (whose alert remedy is “increase
max_probe_holds”, nonsensical when holds are deliberately off).
Scope note: this silences store-backed advertisements only. Content servable from a configured origin takes no hold and is advertised regardless — see the origin-held fallback in the probe handler.
Implementations§
Source§impl ProbeHoldOutcome
impl ProbeHoldOutcome
Sourcepub const fn advertises(self) -> bool
pub const fn advertises(self) -> bool
Whether this outcome authorises signing has_blob: true for the
store-backed answer (the origin-held fallback may still promote a
false afterwards).
Presence governs the answer, not the hold: Self::BudgetExhausted
advertises despite placing no hold, because refusing there would let a
probe flood that fills the hold cache suppress truthful answers.
Sourcepub const fn hold_placed(self) -> bool
pub const fn hold_placed(self) -> bool
Whether an eviction hold was actually placed, making the blob
LRU-exempt for PROBE_HOLD_DURATION.
Distinct from Self::advertises: holds are best-effort, and only
Self::Held consumes a slot.
Trait Implementations§
Source§impl Clone for ProbeHoldOutcome
impl Clone for ProbeHoldOutcome
impl Copy for ProbeHoldOutcome
Source§impl Debug for ProbeHoldOutcome
impl Debug for ProbeHoldOutcome
impl Eq for ProbeHoldOutcome
Source§impl PartialEq for ProbeHoldOutcome
impl PartialEq for ProbeHoldOutcome
impl StructuralPartialEq for ProbeHoldOutcome
Auto Trait Implementations§
impl Freeze for ProbeHoldOutcome
impl RefUnwindSafe for ProbeHoldOutcome
impl Send for ProbeHoldOutcome
impl Sync for ProbeHoldOutcome
impl Unpin for ProbeHoldOutcome
impl UnsafeUnpin for ProbeHoldOutcome
impl UnwindSafe for ProbeHoldOutcome
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more