pub enum CompleteCheckpointState {
Start,
ReadingHeader {
reader: Box<StreamingLogicalLogReader>,
},
DriveEarlyTruncate {
header_result: HeaderReadResult,
checkpoint_result: CheckpointResult,
},
DriveCheckpoint,
AwaitDbFileSync {
completion: Completion,
checkpoint_result: CheckpointResult,
},
RetryHeader {
checkpoint_result: CheckpointResult,
retried_crc: bool,
phase: RetryHeaderPhase,
},
DriveFinalTruncate {
checkpoint_result: CheckpointResult,
},
}Expand description
Sub state machine for
MvStore::maybe_complete_interrupted_checkpoint_nonblock. Tracks the
sequence of IO yields needed to reconcile an interrupted MVCC checkpoint
without blocking: read log header → optional early WAL truncate, or
WAL→DB backfill + db_file.sync + log-header rewrite (with a single-shot
CRC retry) + final WAL truncate.
Variants§
Start
ReadingHeader
Reading the log header via the streaming reader.
Fields
reader: Box<StreamingLogicalLogReader>DriveEarlyTruncate
wal_max_frame == 0 branch: driving the early wal.truncate_wal.
checkpoint_result must persist across IO yields because
truncate_wal/truncate_log tracks its truncate/sync progress through
its wal_truncate_sent / wal_sync_sent flags; recreating it each
re-entry would re-issue the truncate forever.
DriveCheckpoint
Main path: driving wal.checkpoint(Truncate). Reached from a Valid header (reused
via set_header) or a NoLog log (the Passive steady state); the fresh header is
(re)written later in RetryHeader.
AwaitDbFileSync
Awaiting the db_file.sync completion after a successful backfill.
RetryHeader
Retry loop: rewriting the log header + verifying CRC. retried_crc
allows a single retry on torn-tail mismatch before failing closed.
DriveFinalTruncate
Driving the final wal.truncate_wal.
Fields
checkpoint_result: CheckpointResultTrait Implementations§
Source§impl Default for CompleteCheckpointState
impl Default for CompleteCheckpointState
Source§fn default() -> CompleteCheckpointState
fn default() -> CompleteCheckpointState
Auto Trait Implementations§
impl !RefUnwindSafe for CompleteCheckpointState
impl !UnwindSafe for CompleteCheckpointState
impl Freeze for CompleteCheckpointState
impl Send for CompleteCheckpointState
impl Sync for CompleteCheckpointState
impl Unpin for CompleteCheckpointState
impl UnsafeUnpin for CompleteCheckpointState
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more