From 9c20a07d35c4400be0fc697171470b4fd08be74a Mon Sep 17 00:00:00 2001 From: Yao Xiao <87789492+yao-xiao-github@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:21:21 -0700 Subject: [PATCH] Add delete_obsolete_files_period_micros to RocksDB options. (#7908) --- fdbclient/ServerKnobs.cpp | 1 + fdbclient/include/fdbclient/ServerKnobs.h | 1 + fdbserver/KeyValueStoreShardedRocksDB.actor.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/fdbclient/ServerKnobs.cpp b/fdbclient/ServerKnobs.cpp index 27db296b5f..58cfc1c866 100644 --- a/fdbclient/ServerKnobs.cpp +++ b/fdbclient/ServerKnobs.cpp @@ -410,6 +410,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( ROCKSDB_WRITE_BUFFER_SIZE, 1 << 30 ); // 1G init( ROCKSDB_MAX_TOTAL_WAL_SIZE, 0 ); // RocksDB default. init( ROCKSDB_MAX_BACKGROUND_JOBS, 2 ); // RocksDB default. + init( ROCKSDB_DELETE_OBSOLETE_FILE_PERIOD, 21600 ); // 6h, RocksDB default. // Leader election bool longLeaderElection = randomize && BUGGIFY; diff --git a/fdbclient/include/fdbclient/ServerKnobs.h b/fdbclient/include/fdbclient/ServerKnobs.h index 61aca4f904..bba13eb7bc 100644 --- a/fdbclient/include/fdbclient/ServerKnobs.h +++ b/fdbclient/include/fdbclient/ServerKnobs.h @@ -337,6 +337,7 @@ public: int64_t ROCKSDB_WRITE_BUFFER_SIZE; int64_t ROCKSDB_MAX_TOTAL_WAL_SIZE; int64_t ROCKSDB_MAX_BACKGROUND_JOBS; + int64_t ROCKSDB_DELETE_OBSOLETE_FILE_PERIOD; // Leader election int MAX_NOTIFICATIONS; diff --git a/fdbserver/KeyValueStoreShardedRocksDB.actor.cpp b/fdbserver/KeyValueStoreShardedRocksDB.actor.cpp index eb4e48894e..6cd3ccdd17 100644 --- a/fdbserver/KeyValueStoreShardedRocksDB.actor.cpp +++ b/fdbserver/KeyValueStoreShardedRocksDB.actor.cpp @@ -301,6 +301,7 @@ rocksdb::Options getOptions() { options.IncreaseParallelism(SERVER_KNOBS->ROCKSDB_BACKGROUND_PARALLELISM); } + options.delete_obsolete_files_period_micros = SERVER_KNOBS->ROCKSDB_DELETE_OBSOLETE_FILE_PERIOD * 1000000; options.max_total_wal_size = SERVER_KNOBS->ROCKSDB_MAX_TOTAL_WAL_SIZE; options.max_subcompactions = SERVER_KNOBS->ROCKSDB_MAX_SUBCOMPACTIONS; options.max_background_jobs = SERVER_KNOBS->ROCKSDB_MAX_BACKGROUND_JOBS;