Add an unsafe option to disable manual fsyncing rocksdb

This commit is contained in:
Daniel Smith 2020-07-30 22:31:18 +00:00
parent abd2e6b979
commit a94c4cce85
3 changed files with 3 additions and 1 deletions

View File

@ -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");

View File

@ -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;

View File

@ -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;