pub struct RepositoryHealthProbeSpec {
pub enabled: Option<bool>,
pub interval: Option<String>,
pub failure_threshold: Option<i64>,
pub on_failure: Option<ProbeOnFailure>,
}Expand description
Backend health probe, shared by Repository and ClusterRepository. On by
default.
Once a repository reaches Ready, the operator trusts that pinned status and
— for object-store / volume-backed backends — never re-checks the backend on
its steady-state heartbeat. If the kopia repository is wiped or becomes
unreachable, nothing notices until a backup runs and fails. The probe
re-connects the backend every interval and surfaces the
result as the BackendReachable condition + a Warning event.
What happens past failureThreshold consecutive
failures depends on onFailure: with the default
Degrade, the repository moves to Degraded and backups, maintenance, and
replication are paused until a re-connect succeeds (the repository
circuit breaker); with Alert, the repository stays Ready and only the
condition + event + metric fire.
Never destructive. A wiped repository and a transient outage look alike,
and silently recreating an empty repository over a real one destroys
restorability — so the probe never auto-recreates. Acting on a
RepositoryVanished alert (a deliberate re-create) is a human decision.
Fields§
§enabled: Option<bool>Whether the probe runs (default true). false disables probing — and
with it the circuit breaker, since the probe is its only sensor: a wiped
or unreachable backend then goes unnoticed until the next backup fails.
interval: Option<String>How often to re-probe the backend (Go-style duration like 30m or 1h;
minimum 30s, default 30m). Inert when enabled: false.
failure_threshold: Option<i64>How many consecutive failing probes to require before the failure is
acted on (default 3): the loud BackendReachable=False condition +
event fire, and — under onFailure: Degrade — the repository moves to
Degraded. Debounces a single transient blip from alarming, tripping
the breaker, or nudging a destructive manual recreate. Any success
resets it.
on_failure: Option<ProbeOnFailure>What sustained probe failure (past failureThreshold) does to the
repository (default Degrade). Degrade moves it to Degraded,
pausing backups and replication until a re-connect succeeds — recovery
is automatic. Maintenance also pauses when the backend is confirmed
unreachable or the repository vanished, but keeps running when the
degradation is a probe deadline kill (ProbeDeadlineExceeded — index
compaction is often the cure). Alert keeps the repository Ready
and only raises the condition + Warning event + metric (the pre-breaker
behavior); backups keep running against the failing backend.
Implementations§
Source§impl RepositoryHealthProbeSpec
impl RepositoryHealthProbeSpec
Sourcepub fn enabled(health: Option<&RepositoryHealthSpec>) -> bool
pub fn enabled(health: Option<&RepositoryHealthSpec>) -> bool
Whether the backend health probe runs (spec.health.probe.enabled).
This resolver is the load-bearing default (#345), not the CRD schema
default: — a nested schema default only materializes when its parent
object is present, and most specs omit spec.health/probe entirely.
Absent spec/probe/field ⇒
DEFAULT_HEALTH_PROBE_ENABLED
(true); an explicit Some(v) ⇒ v. Every caller resolves through this
single seam, so enabled: false is the one way to opt out.
Sourcepub fn effective_on_failure(
health: Option<&RepositoryHealthSpec>,
) -> ProbeOnFailure
pub fn effective_on_failure( health: Option<&RepositoryHealthSpec>, ) -> ProbeOnFailure
The effective onFailure policy: spec.health.probe.onFailure when set,
else ProbeOnFailure::Degrade — the circuit breaker is the default,
matching the schema default: (which only materializes when the probe
object is present; this resolver covers the absent-parent case).
Sourcepub fn effective_interval(health: Option<&RepositoryHealthSpec>) -> Duration
pub fn effective_interval(health: Option<&RepositoryHealthSpec>) -> Duration
The effective probe cadence used when the probe is enabled:
interval when set and parseable, else DEFAULT_HEALTH_PROBE_INTERVAL.
(The webhook rejects an unparseable value, so the fallback only covers
objects admitted before the validator existed.)
Sourcepub fn effective_failure_threshold(health: Option<&RepositoryHealthSpec>) -> i64
pub fn effective_failure_threshold(health: Option<&RepositoryHealthSpec>) -> i64
The effective consecutive-failure threshold before the loud condition is
raised: failureThreshold when set (clamped to at least 1), else
DEFAULT_HEALTH_PROBE_FAILURE_THRESHOLD.
Trait Implementations§
Source§impl Clone for RepositoryHealthProbeSpec
impl Clone for RepositoryHealthProbeSpec
Source§fn clone(&self) -> RepositoryHealthProbeSpec
fn clone(&self) -> RepositoryHealthProbeSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RepositoryHealthProbeSpec
impl Debug for RepositoryHealthProbeSpec
Source§impl Default for RepositoryHealthProbeSpec
impl Default for RepositoryHealthProbeSpec
Source§fn default() -> RepositoryHealthProbeSpec
fn default() -> RepositoryHealthProbeSpec
Source§impl<'de> Deserialize<'de> for RepositoryHealthProbeSpec
impl<'de> Deserialize<'de> for RepositoryHealthProbeSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RepositoryHealthProbeSpec
Source§impl JsonSchema for RepositoryHealthProbeSpec
impl JsonSchema for RepositoryHealthProbeSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for RepositoryHealthProbeSpec
impl PartialEq for RepositoryHealthProbeSpec
Source§fn eq(&self, other: &RepositoryHealthProbeSpec) -> bool
fn eq(&self, other: &RepositoryHealthProbeSpec) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RepositoryHealthProbeSpec
Auto Trait Implementations§
impl Freeze for RepositoryHealthProbeSpec
impl RefUnwindSafe for RepositoryHealthProbeSpec
impl Send for RepositoryHealthProbeSpec
impl Sync for RepositoryHealthProbeSpec
impl Unpin for RepositoryHealthProbeSpec
impl UnsafeUnpin for RepositoryHealthProbeSpec
impl UnwindSafe for RepositoryHealthProbeSpec
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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