pub struct StandbyRow {
pub name: String,
pub remote: String,
pub pending: u64,
pub consecutive_failures: u32,
pub last_error: String,
pub last_success_unix_ms: i64,
pub needs_full_resync: bool,
pub stale: bool,
pub in_flight: String,
pub outstanding_for_ms: i64,
pub behind: bool,
}Expand description
One standby’s state, flattened.
Fields§
§name: StringThe operator’s name for it.
remote: StringWhere it is.
pending: u64Repositories with work outstanding.
consecutive_failures: u32Consecutive failures for the job at the head of the queue.
last_error: StringThe last failure since the last success.
last_success_unix_ms: i64Zero means NEVER, and that is the value this whole module exists for. Not “unknown”, not “just now”.
needs_full_resync: boolA hole retrying will not close; gunnar control replication resync is
the fix.
stale: boolWork is stuck and nothing has landed for STALENESS_FACTORx the
retry ceiling. See is_stale — this is NOT “the last success is
old”, which is what it used to be and what made an idle box shout.
Never is not folded in here; it is Verdict::Never.
in_flight: StringThe repository an attempt is in flight for, empty when none.
outstanding_for_ms: i64How long the oldest outstanding repository has been outstanding, ms. Zero when there is none.
behind: boolOutstanding work older than the retry ceiling. See BEHIND_AFTER_RETRY_MAX.
Implementations§
Source§impl StandbyRow
impl StandbyRow
Sourcepub fn never_synced(&self) -> bool
pub fn never_synced(&self) -> bool
Has a byte ever reached this standby?
The distinction is not cosmetic. “It has not synced for six hours” is a standby that was working and stopped; “it has never synced” is a standby that has never worked, and the second one means the durability promise on this box does not exist. They need different sentences because they need different actions.
Sourcepub fn verdict(&self) -> Verdict
pub fn verdict(&self) -> Verdict
The one word this row says. See Verdict.
Every surface asks this rather than reading the booleans itself: the console badge, the CLI row, the band and the alarm all print what this returns, so “is it stale?” has exactly one answer per snapshot.
Sourcepub fn since_last_success(&self, now_unix_ms: i64) -> Option<i64>
pub fn since_last_success(&self, now_unix_ms: i64) -> Option<i64>
Seconds since the last success, or None when there has never been
one.
Sourcepub fn describe(&self, synced: u64, failed: u64, now_unix_ms: i64) -> String
pub fn describe(&self, synced: u64, failed: u64, now_unix_ms: i64) -> String
The band’s row and the log line, one writer (one implementation).
standby synced 105 failed 40 last 00:00:03 ago idle
standby synced 0 failed 8 last successful replication: NEVERThe word comes from Self::verdict, so idle is printed rather than
left blank: a row with no word on it is a row an operator has to guess
about, and guessing is what STALE on a healthy box taught them to do.
BEHIND is not repeated here — Self::outstanding carries it beside
the work it is about.
Sourcepub fn outstanding(&self) -> String
pub fn outstanding(&self) -> String
The clock that keeps ticking while a standby is dead, as the tail of
a row: pending 3 in flight alice/x outstanding 00:01:03 BEHIND.
Empty when nothing is outstanding, so a healthy idle standby’s row is unchanged.
Trait Implementations§
Source§impl Clone for StandbyRow
impl Clone for StandbyRow
Source§impl Debug for StandbyRow
impl Debug for StandbyRow
Source§impl Default for StandbyRow
impl Default for StandbyRow
impl Eq for StandbyRow
Source§impl PartialEq for StandbyRow
impl PartialEq for StandbyRow
impl StructuralPartialEq for StandbyRow
Auto Trait Implementations§
impl Freeze for StandbyRow
impl RefUnwindSafe for StandbyRow
impl Send for StandbyRow
impl Sync for StandbyRow
impl Unpin for StandbyRow
impl UnsafeUnpin for StandbyRow
impl UnwindSafe for StandbyRow
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request