From 65cd6cd4b62cbcb8f234bc3d6d25b7241b3ee55c Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Mon, 29 Jan 2018 09:48:58 -0800 Subject: [PATCH] Rewrite comments on use_fsync option Summary: This replaces a vague warning about the mostly-obsolete ext3 filesystem with a more detailed note about a historical bug in the still-relevant ext4. Fixes #3410 Closes https://github.com/facebook/rocksdb/pull/3421 Differential Revision: D6834881 Pulled By: siying fbshipit-source-id: 7771ef5c89a54c0ac17821680779c48178d0b400 --- include/rocksdb/options.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index dbe293d3c..17ba39d45 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -406,13 +406,14 @@ struct DBOptions { // If non-null, then we should collect metrics about database operations std::shared_ptr statistics = nullptr; - // 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. - // Default: false - // Note: on many platforms fdatasync is defined as fsync, so this parameter - // would make no difference. Refer to fdatasync definition in this code base. + // 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. bool use_fsync = false; // A list of paths where SST files can be put into, with its target size.