Skip to main content

ReplayOutcome

Struct ReplayOutcome 

Source
pub struct ReplayOutcome {
    pub committed_events: Vec<MutationEvent>,
    pub max_lsn: Lsn,
    pub torn_tail: Option<TornTailInfo>,
    pub checkpoint_lsn_observed: Option<Lsn>,
}
Expand description

Outcome of a full replay walk.

Fields§

§committed_events: Vec<MutationEvent>

Mutation events from committed transactions, in append order. Apply these to a fresh store (or one freshly loaded from a snapshot at checkpoint_lsn) to reproduce the pre-crash state.

§max_lsn: Lsn

Highest LSN observed in any segment, regardless of whether the owning transaction committed. Used to seed next_lsn for new appends so we never reuse an already-allocated id.

§torn_tail: Option<TornTailInfo>

Torn-tail diagnostic. Some iff a record failed to decode before the natural end-of-log. The caller must truncate the affected segment to last_good_offset before resuming appends, otherwise replay-after-replay will keep tripping the same CRC.

§checkpoint_lsn_observed: Option<Lsn>

Newest checkpoint LSN observed in a [WalRecord::Checkpoint] marker.

Informational only. The recovery contract today is “the snapshot’s wal_lsn is the replay fence” — if the operator passes an older snapshot than the newest checkpoint marker on disk we still replay every record above the snapshot’s fence, which is conservative-correct (the only cost is duplicated work). A tighter “marker overrides snapshot” contract is deferred to v2 because it would require us to know that the marker’s snapshot file actually exists where the operator can reach it, which is a separate observability concern.

Surfaced so callers (e.g. lora-database::Database::recover) can log a warning when the snapshot is older than the newest observed marker.

Trait Implementations§

Source§

impl Debug for ReplayOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.