pub const NOSYNC: Flags;
Expand description
Don’t flush system buffers to disk when committing a
transaction. This optimization means a system crash can corrupt
the database or lose the last transactions if buffers are not
yet flushed to disk. The risk is governed by how often the
system flushes dirty buffers to disk and how often
Environment::sync()
is called. However, if the filesystem
preserves write order and the WRITEMAP
flag is not used,
transactions exhibit ACI (atomicity, consistency, isolation)
properties and only lose D (durability). I.e. database
integrity is maintained, but a system crash may undo the final
transactions. Note that (NOSYNC | WRITEMAP)
leaves the system
with no hint for when to write transactions to disk, unless
Environment::sync()
is called. (MAPASYNC | WRITEMAP)
may be
preferable. This flag may be changed at any time using
Environment::set_flags()
.