add storage.indexedlog-fsync config to turn on fsync

Summary:
The config turns on fsync for all indexedlog writes. It can be useful in places
where we want reliability more than performance with unknown kernel issues.

Reviewed By: sfilipco

Differential Revision: D27347595

fbshipit-source-id: c0b31928684e8805a9e6441062f96b05ad311ea2
This commit is contained in:
Jun Wu 2021-03-30 09:52:57 -07:00 committed by Facebook GitHub Bot
parent c12d660aee
commit 880f7a6b4c

View File

@ -136,6 +136,9 @@ fn initialize_indexedlog(config: &ConfigSet) -> Result<()> {
indexedlog::utils::SYMLINK_ATOMIC_WRITE.store(use_symlink_atomic_write, SeqCst);
}
let fsync: bool = config.get_or_default("storage", "indexedlog-fsync")?;
indexedlog::utils::set_global_fsync(fsync);
Ok(())
}