From 87988c67c0a958d17821f1bd60081c7a34fe9286 Mon Sep 17 00:00:00 2001 From: Change72 Date: Fri, 27 Oct 2023 13:07:51 -0700 Subject: [PATCH] open_direct_io_by_default --- src/config/config.cc | 6 +++++- src/config/config.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/config/config.cc b/src/config/config.cc index 164bb169025..917f74738ac 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -205,7 +205,11 @@ Config::Config() { new IntField(&RocksDB.max_bytes_for_level_multiplier, 10, 1, 100)}, {"rocksdb.level_compaction_dynamic_level_bytes", false, new YesNoField(&RocksDB.level_compaction_dynamic_level_bytes, false)}, - + {"rocksdb.use_direct_reads", true, + new YesNoField(&RocksDB.use_direct_reads, true)}, + {"rocksdb.use_direct_io_for_flush_and_compaction", true, + new YesNoField(&RocksDB.use_direct_io_for_flush_and_compaction, true)}, + /* rocksdb write options */ {"rocksdb.write_options.sync", true, new YesNoField(&RocksDB.write_options.sync, false)}, {"rocksdb.write_options.disable_wal", true, new YesNoField(&RocksDB.write_options.disable_WAL, false)}, diff --git a/src/config/config.h b/src/config/config.h index 4cf7498f69b..b10c967cdad 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -182,7 +182,9 @@ struct Config { int max_bytes_for_level_base; int max_bytes_for_level_multiplier; bool level_compaction_dynamic_level_bytes; - + bool use_direct_reads; + bool use_direct_io_for_flush_and_compaction; + struct WriteOptions { bool sync; bool disable_WAL;