Enum Durability
pub enum Durability {
Record,
Os,
}Expand description
When the log asks the filesystem to make a publication durable.
Both settings stage a complete JSONL image, call sync_data on that image,
and publish it with one atomic rename, so no reader — in this process or
another — can ever observe a half-written record or a stale-generation
append. Record additionally syncs the containing directory after the
rename where the platform exposes that operation. Neither setting can
promise power-loss behavior for an arbitrary filesystem or NFS mount.
Variants§
Record
Sync the staged image after every record and request a containing- directory sync after every publication.
The default. Each mutation still stages the complete current image, so its I/O grows with the image size; see the journal durability documentation and size metrics. The directory sync is a best-effort publication-durability request: arbitrary filesystems and NFS mounts may not provide a power-loss guarantee.
Os
Leave publication metadata durability to the operating system.
The generation-bound copy-on-write protocol still syncs every staged image before its atomic rename: without that, a machine crash could expose a torn prefix rather than lose only a tail. It does not request a containing-directory sync after the journal rename, so the name’s power-loss durability remains filesystem policy. Snapshots retain their own atomic, synced cache publication.
Trait Implementations§
§impl Clone for Durability
impl Clone for Durability
§fn clone(&self) -> Durability
fn clone(&self) -> Durability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more