pub struct TransactionFrameBatch {
pub frames: Vec<FrameSubmission>,
pub conflict_pages: Vec<u32>,
pub conflict_snapshot: Option<TransactionConflictSnapshot>,
pub conflict_page_baselines: Vec<TransactionConflictPageBaseline>,
pub context: TransactionFrameBatchContext,
}Expand description
A batch of frames from a single transaction, submitted atomically.
Fields§
§frames: Vec<FrameSubmission>Frames belonging to this transaction, in write order.
conflict_pages: Vec<u32>Pages that must obey first-committer-wins against committed WAL frames newer than this transaction’s read snapshot.
The process-local MVCC registry catches conflicts between connections in the same process. These fields carry the same commit intent through the process-global WAL group-commit queue so the eventual flusher can also reject stale cross-process commits under the WAL append gate.
conflict_snapshot: Option<TransactionConflictSnapshot>WAL visibility snapshot pinned when the submitting transaction began.
If another process has committed any of conflict_pages after this
horizon, the batch must fail with BUSY_SNAPSHOT instead of appending a
stale page image that could hide the other writer’s committed rows.
conflict_page_baselines: Vec<TransactionConflictPageBaseline>Full-page hashes captured from the submitting transaction’s pinned snapshot, keyed by exact page number.
These are used only when an external checkpoint replaces/resets the WAL generation while the transaction is open. A generation change alone does not prove a write conflict: a stock SQLite reader can checkpoint an otherwise unchanged WAL. The eventual flusher may admit that benign transition only when every conflict candidate has a baseline and the latest committed full-page image hashes identically.
context: TransactionFrameBatchContextLane-local staging context captured before group-commit submission.
Implementations§
Source§impl TransactionFrameBatch
impl TransactionFrameBatch
Sourcepub fn new(frames: Vec<FrameSubmission>) -> Self
pub fn new(frames: Vec<FrameSubmission>) -> Self
Create a new batch with the given frames.
Sourcepub fn with_conflict_snapshot(
self,
conflict_pages: Vec<u32>,
conflict_snapshot: Option<TransactionConflictSnapshot>,
) -> Self
pub fn with_conflict_snapshot( self, conflict_pages: Vec<u32>, conflict_snapshot: Option<TransactionConflictSnapshot>, ) -> Self
Attach cross-process conflict metadata for the submitting transaction.
Sourcepub fn with_conflict_page_baselines(
self,
conflict_page_baselines: Vec<TransactionConflictPageBaseline>,
) -> Self
pub fn with_conflict_page_baselines( self, conflict_page_baselines: Vec<TransactionConflictPageBaseline>, ) -> Self
Attach snapshot-bound full-page hashes for WAL-generation transitions.
Sourcepub fn with_context(self, context: TransactionFrameBatchContext) -> Self
pub fn with_context(self, context: TransactionFrameBatchContext) -> Self
Attach lane-local staging context to this batch.
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Number of frames in this batch.
Sourcepub fn has_commit_frame(&self) -> bool
pub fn has_commit_frame(&self) -> bool
Whether this batch contains a commit frame (last frame has db_size > 0).
Trait Implementations§
Source§impl Clone for TransactionFrameBatch
impl Clone for TransactionFrameBatch
Source§fn clone(&self) -> TransactionFrameBatch
fn clone(&self) -> TransactionFrameBatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more