From 880f7a6b4c45868b6aed4acfd9c98f027137033e Mon Sep 17 00:00:00 2001 From: Jun Wu Date: Tue, 30 Mar 2021 09:52:57 -0700 Subject: [PATCH] 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 --- eden/scm/lib/clidispatch/src/dispatch.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eden/scm/lib/clidispatch/src/dispatch.rs b/eden/scm/lib/clidispatch/src/dispatch.rs index 0a34ac10fb..1efbbb31ab 100644 --- a/eden/scm/lib/clidispatch/src/dispatch.rs +++ b/eden/scm/lib/clidispatch/src/dispatch.rs @@ -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(()) }