pub struct RangeStreamProgress {
pub range_id: u64,
pub applied_lsn: u64,
pub streamed_lsn: u64,
pub primary_lsn: u64,
}Expand description
Independent streaming progress for one range over the shared physical WAL.
All three LSNs are global WAL LSNs scoped to this range’s records:
primary_lsn is the highest the primary has produced for the range,
streamed_lsn the highest shipped to the follower, applied_lsn the
highest the follower has durably applied. Their gaps give per-range lag that
is independent of every other range riding the same WAL — the basis for
per-range failover eligibility (issue #987).
Fields§
§range_id: u64§applied_lsn: u64§streamed_lsn: u64§primary_lsn: u64Implementations§
Source§impl RangeStreamProgress
impl RangeStreamProgress
pub fn new(range_id: u64) -> RangeStreamProgress
Sourcepub fn apply_lag(&self) -> u64
pub fn apply_lag(&self) -> u64
Records this range still has to apply to match the primary frontier. Saturating so a follower transiently ahead of an observed frontier reports zero rather than underflowing.
Sourcepub fn stream_lag(&self) -> u64
pub fn stream_lag(&self) -> u64
Records produced for this range that have not yet been shipped.
Sourcepub fn is_caught_up(&self) -> bool
pub fn is_caught_up(&self) -> bool
Whether the follower has applied everything the primary has produced for the range. False until a primary frontier has actually been observed, so an unknown range is never reported as caught up.
Sourcepub fn failover_eligible(&self, max_lag: u64) -> bool
pub fn failover_eligible(&self, max_lag: u64) -> bool
Whether this range is within max_lag records of the primary — a
per-range gate a later failover decision can consult. Requires an
observed primary frontier.
pub fn encode_json(&self) -> Vec<u8> ⓘ
pub fn decode_json( bytes: &[u8], ) -> Result<RangeStreamProgress, ReplicationPayloadError>
Trait Implementations§
Source§impl Clone for RangeStreamProgress
impl Clone for RangeStreamProgress
Source§fn clone(&self) -> RangeStreamProgress
fn clone(&self) -> RangeStreamProgress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RangeStreamProgress
Source§impl Debug for RangeStreamProgress
impl Debug for RangeStreamProgress
impl Eq for RangeStreamProgress
Source§impl PartialEq for RangeStreamProgress
impl PartialEq for RangeStreamProgress
Source§fn eq(&self, other: &RangeStreamProgress) -> bool
fn eq(&self, other: &RangeStreamProgress) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RangeStreamProgress
Auto Trait Implementations§
impl Freeze for RangeStreamProgress
impl RefUnwindSafe for RangeStreamProgress
impl Send for RangeStreamProgress
impl Sync for RangeStreamProgress
impl Unpin for RangeStreamProgress
impl UnsafeUnpin for RangeStreamProgress
impl UnwindSafe for RangeStreamProgress
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