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: LsnHighest 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.