pub struct CatchUpEvidence {
pub candidate: NodeIdentity,
pub applied_term: u64,
pub applied_lsn: u64,
}Expand description
Evidence that a candidate has caught up enough to take ownership safely: the
(term, lsn) its log has durably applied for the range. The supervisor
collects this from the candidate’s per-range stream progress (issue #992)
before requesting a transition; the machine admits the candidate only if this
covers the CommitWatermark.
Fields§
§candidate: NodeIdentityThe node this evidence describes. Must match the transition target, so a planner cannot present one node’s progress to promote another.
applied_term: u64The highest term the candidate has applied for the range.
applied_lsn: u64The highest WAL LSN the candidate has applied for the range.
Implementations§
Source§impl CatchUpEvidence
impl CatchUpEvidence
pub fn new( candidate: NodeIdentity, applied_term: u64, applied_lsn: u64, ) -> CatchUpEvidence
Sourcepub fn covers(&self, watermark: CommitWatermark) -> bool
pub fn covers(&self, watermark: CommitWatermark) -> bool
Does this evidence cover the watermark? The candidate must be on at least the watermark term and, on that term, have applied at least its LSN. A candidate behind on either axis is fenced out of promotion.
Trait Implementations§
Source§impl Clone for CatchUpEvidence
impl Clone for CatchUpEvidence
Source§fn clone(&self) -> CatchUpEvidence
fn clone(&self) -> CatchUpEvidence
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 CatchUpEvidence
impl Debug for CatchUpEvidence
impl Eq for CatchUpEvidence
Source§impl PartialEq for CatchUpEvidence
impl PartialEq for CatchUpEvidence
Source§fn eq(&self, other: &CatchUpEvidence) -> bool
fn eq(&self, other: &CatchUpEvidence) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CatchUpEvidence
Auto Trait Implementations§
impl Freeze for CatchUpEvidence
impl RefUnwindSafe for CatchUpEvidence
impl Send for CatchUpEvidence
impl Sync for CatchUpEvidence
impl Unpin for CatchUpEvidence
impl UnsafeUnpin for CatchUpEvidence
impl UnwindSafe for CatchUpEvidence
Blanket Implementations§
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
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§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 moreSource§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