pub struct RollbackPlan {
pub recover_to_lsn: u64,
pub local_frontier: u64,
pub commit_watermark: u64,
pub tail_lsns: u64,
}Expand description
The computed, side-effect-free rollback plan. Splitting this out lets the boundary invariant be asserted without driving any transport.
Fields§
§recover_to_lsn: u64The recover-to-LSN target: the common point with the new primary.
local_frontier: u64The deposed primary’s local frontier (inclusive tail upper bound).
commit_watermark: u64The commit watermark — the durable floor that bounds the recover target from below.
tail_lsns: u64Number of LSNs the tail spans (local_frontier - recover_to_lsn).
Implementations§
Source§impl RollbackPlan
impl RollbackPlan
Sourcepub fn compute(req: &RollbackRequest) -> Result<Self, RollbackError>
pub fn compute(req: &RollbackRequest) -> Result<Self, RollbackError>
Compute and validate the rollback plan for req.
Enforces the hard invariant: the recover target (common point) must be at or above the commit watermark, so nothing at or below the watermark is ever rolled back. A common point below the watermark means the election handed us a target that would discard committed data — a contract violation we refuse rather than honour.
Sourcepub fn has_divergent_tail(&self) -> bool
pub fn has_divergent_tail(&self) -> bool
Whether there is a divergent tail to roll back. When the local frontier is at or below the common point the node is already on the shared timeline and only needs to rejoin.
Trait Implementations§
Source§impl Clone for RollbackPlan
impl Clone for RollbackPlan
Source§fn clone(&self) -> RollbackPlan
fn clone(&self) -> RollbackPlan
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 RollbackPlan
impl Debug for RollbackPlan
impl Eq for RollbackPlan
Source§impl PartialEq for RollbackPlan
impl PartialEq for RollbackPlan
Source§fn eq(&self, other: &RollbackPlan) -> bool
fn eq(&self, other: &RollbackPlan) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RollbackPlan
Auto Trait Implementations§
impl Freeze for RollbackPlan
impl RefUnwindSafe for RollbackPlan
impl Send for RollbackPlan
impl Sync for RollbackPlan
impl Unpin for RollbackPlan
impl UnsafeUnpin for RollbackPlan
impl UnwindSafe for RollbackPlan
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