pub struct PathRefreshingWalBackend<V: Vfs>{ /* private fields */ }Expand description
WAL backend that can recover when the path-visible -wal sidecar is
removed or replaced while this process still owns an old file descriptor.
Real SQLite can checkpoint and unlink/reset db-wal when it does not know
about a live FrankenSQLite handle. WalFile::refresh is intentionally
descriptor-local, so it cannot notice that path-level mutation. This wrapper
performs a path probe before mutable WAL operations and swaps in a freshly
opened/created WalFile when the path-visible sidecar no longer matches the
open handle.
Implementations§
Source§impl<V> PathRefreshingWalBackend<V>
impl<V> PathRefreshingWalBackend<V>
Trait Implementations§
Source§impl<V> WalBackend for PathRefreshingWalBackend<V>
impl<V> WalBackend for PathRefreshingWalBackend<V>
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, ()>
Prepare WAL state for a newly-started transaction. Read more
Source§fn published_snapshot(&self) -> Option<WalPublicationSnapshot>
fn published_snapshot(&self) -> Option<WalPublicationSnapshot>
Capture the currently published WAL visibility summary for this handle. Read more
Source§fn pinned_read_snapshot(&self) -> Option<WalPublicationSnapshot>
fn pinned_read_snapshot(&self) -> Option<WalPublicationSnapshot>
Capture the currently pinned read snapshot for this handle, if any. Read more
Source§fn pinned_logical_read_snapshot<'a>(
&'a self,
cx: &'a Cx,
) -> WalFuture<'a, Option<WalLogicalReadSnapshot>>
fn pinned_logical_read_snapshot<'a>( &'a self, cx: &'a Cx, ) -> WalFuture<'a, Option<WalLogicalReadSnapshot>>
Return an authorized logical horizon for the currently pinned reader
snapshot, if the backend can prove one. Read more
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>>
Refresh the published WAL visibility summary without pinning a new
read transaction. Read more
Publish a commit batch that the pager’s parallel-WAL protocol has
already authorized after every tracked write completed. Read more
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, ()>
Append a single frame to the WAL. Read more
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, ()>
Append a batch of frames to the WAL. Read more
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, ()>
Append a batch while retaining a source-level completion observation. Read more
Source§fn prepare_append_frames(
&self,
frames: &[WalFrameRef<'_>],
) -> Result<Option<PreparedWalFrameBatch>>
fn prepare_append_frames( &self, frames: &[WalFrameRef<'_>], ) -> Result<Option<PreparedWalFrameBatch>>
Prepare a batch of frames for a later append. Read more
Source§fn finalize_prepared_frames(
&self,
cx: &Cx,
prepared: &mut PreparedWalFrameBatch,
) -> Result<()>
fn finalize_prepared_frames( &self, cx: &Cx, prepared: &mut PreparedWalFrameBatch, ) -> Result<()>
Optionally finalize a prepared batch before the serialized append. Read more
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, ()>
Append a previously prepared frame batch. Read more
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, ()>
Append a prepared batch with a caller-retained completion token.
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,
) -> WalFuture<'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, ) -> WalFuture<'a, ()>
Append the certificate proof that authorizes the next WAL frame
interval. Implementations must bind the record to their current WAL
generation and make it durable when
sync is true. Read moreSource§fn persist_parallel_wal_commit_certificate_tracked<'a>(
&'a mut self,
cx: &'a Cx,
certificate: &'a ParallelWalCommitCertificate,
wal_frame_start: u64,
wal_frame_end: u64,
sync: bool,
completion: VfsWriteCompletion,
) -> WalFuture<'a, ()>
fn persist_parallel_wal_commit_certificate_tracked<'a>( &'a mut self, cx: &'a Cx, certificate: &'a ParallelWalCommitCertificate, wal_frame_start: u64, wal_frame_end: u64, sync: bool, completion: VfsWriteCompletion, ) -> WalFuture<'a, ()>
Persist the certificate sidecar write with source-level completion
evidence retained independently of this future.
Source§fn reconcile_parallel_wal_commit<'a>(
&'a mut self,
cx: &'a Cx,
certificate: &'a ParallelWalCommitCertificate,
wal_frame_start: u64,
wal_frame_end: u64,
sync: bool,
) -> WalFuture<'a, ParallelWalCommitReconciliation>
fn reconcile_parallel_wal_commit<'a>( &'a mut self, cx: &'a Cx, certificate: &'a ParallelWalCommitCertificate, wal_frame_start: u64, wal_frame_end: u64, sync: bool, ) -> WalFuture<'a, ParallelWalCommitReconciliation>
Reconcile one exact in-doubt certificate and WAL interval while the
caller retains the external writer gate. Read more
Return the newest durable certificate usable to seed the next logical
commit clock. Read more
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>>>
Look up the latest version of a page in the current visible WAL snapshot. Read more
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>>>
Read a page from the WAL using a previously pinned read snapshot. Read more
Source§fn supports_pinned_reads(&self) -> bool
fn supports_pinned_reads(&self) -> bool
Whether this backend supports
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>
Count committed transactions that occur after the latest committed
frame for
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>>
Return conflict pages that were committed after
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>
Count committed transactions visible in the current WAL snapshot. Read more
Source§fn frame_count(&self) -> usize
fn frame_count(&self) -> usize
Number of valid frames currently in the WAL.
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>
Run a checkpoint to transfer frames from the WAL to the database. Read more
Auto Trait Implementations§
impl<V> Freeze for PathRefreshingWalBackend<V>
impl<V> RefUnwindSafe for PathRefreshingWalBackend<V>
impl<V> Send for PathRefreshingWalBackend<V>
impl<V> Sync for PathRefreshingWalBackend<V>
impl<V> Unpin for PathRefreshingWalBackend<V>
impl<V> UnsafeUnpin for PathRefreshingWalBackend<V>
impl<V> UnwindSafe for PathRefreshingWalBackend<V>
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
Mutably borrows from an owned value. Read more
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).