pub enum SyncMode {
PerCommit,
Group {
interval_ms: u32,
},
None,
}Expand description
Durability mode for committed transactions.
The engine has at most one concurrent committer at a time, so the
classical group-commit win — overlapping fsyncs across many committers —
does not apply here. SyncMode::PerCommit is the default. The other two
modes exist for narrow operational profiles.
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.
Group
Write commit bytes to the OS immediately, then fsync on a fixed
cadence on a background thread. This survives ordinary process death
after flush() returns, but can still trade the last interval_ms of
commits on power loss or kernel crash for higher throughput on
bulk-load workloads.
A background fsync failure poisons the WAL: the next commit /
flush / force_fsync returns crate::WalError::Poisoned and
Wal::bg_failure reports the underlying cause. Operators
inspect that via /admin/wal/status (bgFailure) and recover
by restarting from the last consistent snapshot + 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.