pub enum WalSyncMode {
Full,
Normal,
Off,
}Expand description
Durability mode for the WAL — analogous to SQLite’s PRAGMA synchronous
combined with journal_mode=OFF.
-
Full— every mutation appends a record andflush()callssync_data()so the OS guarantees the bytes hit stable storage before the call returns. This is the default and the only safe choice when crash recovery must be perfect. -
Off— everyappend()andflush()is a zero-work no-op. No CRC, no BufWriter, no fsync, no recovery. This matches SQLite’s:memory:semantics and is the only way to compare apples-to-apples against in-memory engines in benches. Never use this in production — a crash loses every mutation since the lastCatalog::checkpoint().
Variants§
Full
Normal
Normal — every commit buffers its record through to the OS
(BufWriter::flush, so the bytes are file-visible) and returns
WITHOUT an fsync; a background flusher fsyncs on a fixed interval
(NORMAL_FSYNC_INTERVAL). A process crash loses nothing (replay
reads the bytes already in the OS page cache); an OS crash / power
loss can lose only the unsynced tail (≤ one interval of writes). This
is SQLite synchronous=NORMAL / Postgres synchronous_commit=off
semantics: opt-in, bounded-loss, and ~15–40× faster single-row writes
because the fsync leaves the commit/lock path.
Off
Trait Implementations§
Source§impl Clone for WalSyncMode
impl Clone for WalSyncMode
Source§fn clone(&self) -> WalSyncMode
fn clone(&self) -> WalSyncMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more