pub struct WalBackendAdapter<F: VfsFile> { /* private fields */ }Implementations§
Source§impl<F: VfsFile> WalBackendAdapter<F>
impl<F: VfsFile> WalBackendAdapter<F>
Sourcepub fn with_fec_hook(wal: WalFile<F>, hook: FecCommitHook) -> Self
pub fn with_fec_hook(wal: WalFile<F>, hook: FecCommitHook) -> Self
Wrap an existing WalFile with an FEC commit hook.
Sourcepub fn has_pending_publication(&self) -> bool
pub fn has_pending_publication(&self) -> bool
Whether staged, unpublished frames remain.
Staged frames may already be durable — an intermediate sync makes them so without committing them — but they are not yet part of the published visibility plane. Callers that would discard, consume, or replace this adapter must check this first: dropping the staged metadata loses the batch, and a freshly wrapped adapter would republish those frames straight from the WAL with no knowledge of their publication state (GH #187).
Sourcepub fn into_inner(self) -> Result<WalFile<F>>
pub fn into_inner(self) -> Result<WalFile<F>>
Consume the adapter and return the inner WalFile.
Fails closed while staged, unpublished frames remain: consuming the
adapter discards the staged publication metadata, and the WalFile can
be rewrapped by an adapter that would then publish those frames without
knowing whether they were ever published or fsynced (GH #187). Drain the
batch with a successful commit sync first.
Returns FrankenError::Busy: this is a retryable ordering condition,
not database corruption.
Sourcepub fn inner_mut(&mut self) -> Result<&mut WalFile<F>>
pub fn inner_mut(&mut self) -> Result<&mut WalFile<F>>
Mutably borrow the inner WalFile for explicit external mutation.
Invalidates the publication plane, since the caller may mutate WAL state arbitrarily. That invalidation discards any staged batch, so this fails closed while one exists rather than silently dropping the commit horizon (GH #187): after the discard, a later publish would see no pending state and could expose frames that were never fsynced. Drain the batch with a successful sync first.
Sourcepub fn published_snapshot(&self) -> WalPublicationSnapshot
pub fn published_snapshot(&self) -> WalPublicationSnapshot
Capture the currently published WAL visibility summary for this handle.
This is a cheap snapshot of the publication plane the adapter has
already materialized. Call Self::refresh_published_snapshot first if
the caller needs to bind to the latest on-disk committed prefix.
Sourcepub fn pinned_read_snapshot(&self) -> Option<WalPublicationSnapshot>
pub fn pinned_read_snapshot(&self) -> Option<WalPublicationSnapshot>
Capture the currently pinned read snapshot, if this handle has one.
Sourcepub async fn refresh_published_snapshot(
&mut self,
cx: &Cx,
) -> Result<WalPublicationSnapshot>
pub async fn refresh_published_snapshot( &mut self, cx: &Cx, ) -> Result<WalPublicationSnapshot>
Refresh this handle from disk and republish the latest committed WAL visibility summary without pinning a read transaction.
Sourcepub fn take_fec_pending(&mut self) -> Vec<FecCommitResult>
pub fn take_fec_pending(&mut self) -> Vec<FecCommitResult>
Take any pending FEC commit results for sidecar persistence.
Sourcepub fn fec_enabled(&self) -> bool
pub fn fec_enabled(&self) -> bool
Whether FEC encoding is active.
Sourcepub fn fec_discard(&mut self)
pub fn fec_discard(&mut self)
Discard buffered FEC pages (e.g. on transaction rollback).
Trait Implementations§
Source§impl<F: VfsFile> WalBackend for WalBackendAdapter<F>
impl<F: VfsFile> WalBackend for WalBackendAdapter<F>
Source§fn begin_transaction<'a>(&'a mut self, cx: &'a Cx) -> WalFuture<'a, ()>
fn begin_transaction<'a>(&'a mut self, cx: &'a Cx) -> WalFuture<'a, ()>
Source§fn published_snapshot(&self) -> Option<WalPublicationSnapshot>
fn published_snapshot(&self) -> Option<WalPublicationSnapshot>
Source§fn pinned_read_snapshot(&self) -> Option<WalPublicationSnapshot>
fn pinned_read_snapshot(&self) -> Option<WalPublicationSnapshot>
Source§fn refresh_published_snapshot<'a>(
&'a mut self,
cx: &'a Cx,
) -> WalFuture<'a, Option<WalPublicationSnapshot>>
fn refresh_published_snapshot<'a>( &'a mut self, cx: &'a Cx, ) -> WalFuture<'a, Option<WalPublicationSnapshot>>
Source§fn append_frame<'a>(
&'a mut self,
cx: &'a Cx,
page_number: u32,
page_data: &'a [u8],
db_size_if_commit: u32,
) -> WalFuture<'a, ()>
fn append_frame<'a>( &'a mut self, cx: &'a Cx, page_number: u32, page_data: &'a [u8], db_size_if_commit: u32, ) -> WalFuture<'a, ()>
Source§fn append_frames<'a>(
&'a mut self,
cx: &'a Cx,
frames: &'a [WalFrameRef<'a>],
) -> WalFuture<'a, ()>
fn append_frames<'a>( &'a mut self, cx: &'a Cx, frames: &'a [WalFrameRef<'a>], ) -> WalFuture<'a, ()>
Source§fn append_frames_tracked<'a>(
&'a mut self,
cx: &'a Cx,
frames: &'a [WalFrameRef<'a>],
completion: VfsWriteCompletion,
) -> WalFuture<'a, ()>
fn append_frames_tracked<'a>( &'a mut self, cx: &'a Cx, frames: &'a [WalFrameRef<'a>], completion: VfsWriteCompletion, ) -> WalFuture<'a, ()>
Source§fn prepare_append_frames(
&self,
frames: &[WalFrameRef<'_>],
) -> Result<Option<PreparedWalFrameBatch>>
fn prepare_append_frames( &self, frames: &[WalFrameRef<'_>], ) -> Result<Option<PreparedWalFrameBatch>>
Source§fn finalize_prepared_frames(
&self,
_cx: &Cx,
prepared: &mut PreparedWalFrameBatch,
) -> Result<()>
fn finalize_prepared_frames( &self, _cx: &Cx, prepared: &mut PreparedWalFrameBatch, ) -> Result<()>
Source§fn append_prepared_frames<'a>(
&'a mut self,
cx: &'a Cx,
prepared: &'a mut PreparedWalFrameBatch,
) -> WalFuture<'a, ()>
fn append_prepared_frames<'a>( &'a mut self, cx: &'a Cx, prepared: &'a mut PreparedWalFrameBatch, ) -> WalFuture<'a, ()>
Source§fn append_prepared_frames_tracked<'a>(
&'a mut self,
cx: &'a Cx,
prepared: &'a mut PreparedWalFrameBatch,
completion: VfsWriteCompletion,
) -> WalFuture<'a, ()>
fn append_prepared_frames_tracked<'a>( &'a mut self, cx: &'a Cx, prepared: &'a mut PreparedWalFrameBatch, completion: VfsWriteCompletion, ) -> WalFuture<'a, ()>
Source§fn read_page<'a>(
&'a mut self,
cx: &'a Cx,
page_number: u32,
) -> WalFuture<'a, Option<Vec<u8>>>
fn read_page<'a>( &'a mut self, cx: &'a Cx, page_number: u32, ) -> WalFuture<'a, Option<Vec<u8>>>
Source§fn read_page_pinned<'a>(
&'a self,
cx: &'a Cx,
page_number: u32,
) -> WalFuture<'a, Option<Vec<u8>>>
fn read_page_pinned<'a>( &'a self, cx: &'a Cx, page_number: u32, ) -> WalFuture<'a, Option<Vec<u8>>>
Source§fn supports_pinned_reads(&self) -> bool
fn supports_pinned_reads(&self) -> bool
read_page_pinned (shared-lock reads). Read moreSource§fn committed_txns_since_page<'a>(
&'a mut self,
cx: &'a Cx,
page_number: u32,
) -> WalFuture<'a, u64>
fn committed_txns_since_page<'a>( &'a mut self, cx: &'a Cx, page_number: u32, ) -> WalFuture<'a, u64>
page_number in the current visible WAL snapshot. Read moreSource§fn conflicting_pages_since_snapshot<'a>(
&'a mut self,
cx: &'a Cx,
snapshot: TransactionConflictSnapshot,
page_numbers: &'a [u32],
_page_baselines: &'a [TransactionConflictPageBaseline],
) -> WalFuture<'a, Vec<u32>>
fn conflicting_pages_since_snapshot<'a>( &'a mut self, cx: &'a Cx, snapshot: TransactionConflictSnapshot, page_numbers: &'a [u32], _page_baselines: &'a [TransactionConflictPageBaseline], ) -> WalFuture<'a, Vec<u32>>
snapshot. Read moreSource§fn committed_txn_count<'a>(&'a mut self, cx: &'a Cx) -> WalFuture<'a, u64>
fn committed_txn_count<'a>(&'a mut self, cx: &'a Cx) -> WalFuture<'a, u64>
Source§fn frame_count(&self) -> usize
fn frame_count(&self) -> usize
Source§fn checkpoint<'a>(
&'a mut self,
cx: &'a Cx,
mode: CheckpointMode,
writer: &'a mut dyn CheckpointPageWriter,
backfilled_frames: u32,
oldest_reader_frame: Option<u32>,
) -> WalFuture<'a, CheckpointResult>
fn checkpoint<'a>( &'a mut self, cx: &'a Cx, mode: CheckpointMode, writer: &'a mut dyn CheckpointPageWriter, backfilled_frames: u32, oldest_reader_frame: Option<u32>, ) -> WalFuture<'a, CheckpointResult>
Source§fn pinned_logical_read_snapshot<'a>(
&'a self,
_cx: &'a Cx,
) -> Pin<Box<dyn Future<Output = Result<Option<WalLogicalReadSnapshot>, FrankenError>> + Send + 'a>>
fn pinned_logical_read_snapshot<'a>( &'a self, _cx: &'a Cx, ) -> Pin<Box<dyn Future<Output = Result<Option<WalLogicalReadSnapshot>, FrankenError>> + Send + 'a>>
Source§fn persist_parallel_wal_commit_certificate<'a>(
&'a mut self,
_cx: &'a Cx,
_certificate: &'a ParallelWalCommitCertificate,
_wal_frame_start: u64,
_wal_frame_end: u64,
_sync: bool,
) -> Pin<Box<dyn Future<Output = Result<(), FrankenError>> + Send + 'a>>
fn persist_parallel_wal_commit_certificate<'a>( &'a mut self, _cx: &'a Cx, _certificate: &'a ParallelWalCommitCertificate, _wal_frame_start: u64, _wal_frame_end: u64, _sync: bool, ) -> Pin<Box<dyn Future<Output = Result<(), FrankenError>> + Send + 'a>>
sync is true. Read more