about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/local-store.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 950e6e7608f1..ca541e1cce2e 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -968,8 +968,12 @@ void LocalStore::registerValidPath(const ValidPathInfo & info)
 
 void LocalStore::registerValidPaths(const ValidPathInfos & infos)
 {
-    if (queryBoolSetting("sync-before-registering", true))
+    /* sqlite will fsync by default, but the new valid paths may not be fsync-ed.
+     * So some may want to fsync them before registering the validity, at the
+     * expense of some speed of the path registering operation. */
+    if (queryBoolSetting("sync-before-registering", false))
         sync();
+
     while (1) {
         try {
             SQLiteTxn txn(db);