pub enum CommitState<Clock: LogicalClock, A: ConcurrentAllocator = TursoAllocator> {
Show 14 variants
Initial,
Commit {
end_ts: u64,
},
WaitForDependencies {
end_ts: u64,
},
BuildLogRecord(BuildLogRecordCtx),
BeginCommitLogicalLog {
end_ts: u64,
log_record: LogRecord,
},
UpgradeLogicalLogHeader {
end_ts: u64,
log_record: LogRecord,
},
WriteLogicalLog {
end_ts: u64,
log_record: LogRecord,
},
FinishLogicalLogWrite {
end_ts: u64,
},
SyncLogicalLog {
end_ts: u64,
},
EndCommitLogicalLog {
end_ts: u64,
},
Checkpoint {
state_machine: Mutex<StateMachine<CheckpointStateMachine<Clock, A>>>,
},
CommitEnd {
end_ts: u64,
},
RewriteLiveVersions(RewriteLiveVersionsCtx),
FinalizeCommit {
end_ts: u64,
},
}Variants§
Initial
Commit
WaitForDependencies
Wait for unresolved commit dependencies before building the durable committed view for the logical log. Hekaton Section 3.2: “If T passes validation, it must wait for outstanding commit dependencies to be resolved.”
BuildLogRecord(BuildLogRecordCtx)
Build the committed log record incrementally, yielding every
MVCC_COMMIT_BATCH_SIZE rowids so that very large write sets
(e.g. CREATE INDEX on a multi-million row table) don’t monopolize
the executor.
BeginCommitLogicalLog
UpgradeLogicalLogHeader
WriteLogicalLog
FinishLogicalLogWrite
SyncLogicalLog
EndCommitLogicalLog
Checkpoint
Fields
state_machine: Mutex<StateMachine<CheckpointStateMachine<Clock, A>>>CommitEnd
RewriteLiveVersions(RewriteLiveVersionsCtx)
Publish committed timestamps into the live MVCC chains in chunks
of MVCC_COMMIT_BATCH_SIZE rowids, yielding between chunks. The
transaction is already in the Committed state at this point, so
readers consult txs[tx_id] to resolve any TxID references that
haven’t been rewritten yet.
FinalizeCommit
Final post-rewrite cleanup: drain commit dependents, release the commit lock, update the global header, finish the tx, and start auto-checkpoint if needed.
Trait Implementations§
Source§impl<Clock: LogicalClock, A: ConcurrentAllocator> Debug for CommitState<Clock, A>
impl<Clock: LogicalClock, A: ConcurrentAllocator> Debug for CommitState<Clock, A>
Auto Trait Implementations§
impl<Clock, A = TursoAllocator> !Freeze for CommitState<Clock, A>
impl<Clock, A = TursoAllocator> !RefUnwindSafe for CommitState<Clock, A>
impl<Clock, A = TursoAllocator> !UnwindSafe for CommitState<Clock, A>
impl<Clock, A> Send for CommitState<Clock, A>
impl<Clock, A> Sync for CommitState<Clock, A>
impl<Clock, A> Unpin for CommitState<Clock, A>
impl<Clock, A> UnsafeUnpin for CommitState<Clock, A>
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