diff --git a/fdbserver/KeyValueStoreRocksDB.actor.cpp b/fdbserver/KeyValueStoreRocksDB.actor.cpp index 7a3a6afe5e..3ae8d6c84d 100644 --- a/fdbserver/KeyValueStoreRocksDB.actor.cpp +++ b/fdbserver/KeyValueStoreRocksDB.actor.cpp @@ -92,7 +92,7 @@ struct RocksDBKeyValueStore : IKeyValueStore { }; void action(CommitAction& a) { rocksdb::WriteOptions options; - options.sync = true; + options.sync = !SERVER_KNOBS->ROCKSDB_UNSAFE_AUTO_FSYNC; auto s = db->Write(options, a.batchToCommit.get()); if (!s.ok()) { TraceEvent(SevError, "RocksDBError").detail("Error", s.ToString()).detail("Method", "Commit"); diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp index 120c960102..b5a15d6ca0 100644 --- a/fdbserver/Knobs.cpp +++ b/fdbserver/Knobs.cpp @@ -311,6 +311,7 @@ void ServerKnobs::initialize(bool randomize, ClientKnobs* clientKnobs, bool isSi // KeyValueStoreRocksDB init( ROCKSDB_BACKGROUND_PARALLELISM, 0 ); init( ROCKSDB_MEMTABLE_BYTES, 512 * 1024 * 1024 ); + init( ROCKSDB_UNSAFE_AUTO_FSYNC, false ); // Leader election bool longLeaderElection = randomize && BUGGIFY; diff --git a/fdbserver/Knobs.h b/fdbserver/Knobs.h index 61d0969333..2ea5660154 100644 --- a/fdbserver/Knobs.h +++ b/fdbserver/Knobs.h @@ -246,6 +246,7 @@ public: // KeyValueStoreRocksDB int ROCKSDB_BACKGROUND_PARALLELISM; int64_t ROCKSDB_MEMTABLE_BYTES; + bool ROCKSDB_UNSAFE_AUTO_FSYNC; // Leader election int MAX_NOTIFICATIONS;