pub enum SyncMode {
PerCommit,
Group {
interval_ms: u32,
},
None,
}Expand description
Durability mode for committed transactions.
The current release has at most one committer at a time. The enum still
names the durability strategies we want long term, but no mode requires a
background thread today. SyncMode::PerCommit is the default.
Variants§
PerCommit
fsync the active segment before the committing thread releases the
store write lock. The strongest durability guarantee the WAL offers;
every observed query result is fully durable on native filesystems.
On wasm32-unknown-unknown, fsync is intentionally a no-op.
Group
Write commit bytes to the OS immediately, but defer fsync until an
explicit force_fsync, checkpoint, Database::sync, or clean WAL
drop. The interval is retained as part of the public configuration so a
later release can add a background/group flusher without changing
callers, but it is not scheduled in the single-threaded release.
A future background fsync failure will poison the WAL through the
existing Wal::bg_failure surface. In this release, Group mode is
cooperative, so that field remains None unless another caller poisons
the WAL.
None
Append but never fsync from the WAL; rely on whatever the OS
happens to flush. Intended for CDC-only deployments where the WAL
is consumed by an external reader and durability is provided
elsewhere.