From f062c64d4f5afee434c87f8e335026f610fb227f Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Mon, 25 Jul 2022 19:56:55 +0300 Subject: [PATCH] Update set_use_fsync comment (#659) --- src/db_options.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/db_options.rs b/src/db_options.rs index d1e51520f..73766840a 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -1506,10 +1506,14 @@ impl Options { } } - /// If true, then every store to stable storage will issue a fsync. - /// If false, then every store to stable storage will issue a fdatasync. - /// This parameter should be set to true while storing data to - /// filesystem like ext3 that can lose files after a reboot. + /// By default, writes to stable storage use fdatasync (on platforms + /// where this function is available). If this option is true, + /// fsync is used instead. + /// + /// fsync and fdatasync are equally safe for our purposes and fdatasync is + /// faster, so it is rarely necessary to set this option. It is provided + /// as a workaround for kernel/filesystem bugs, such as one that affected + /// fdatasync with ext4 in kernel versions prior to 3.7. /// /// Default: `false` ///