Add knob for periodic compactions

This commit is contained in:
Daniel Smith 2020-08-11 18:00:01 +00:00
parent 1245143ec1
commit 9065fb3127
3 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,9 @@ rocksdb::Options getOptions() {
}
options.level_compaction_dynamic_level_bytes = true;
options.OptimizeLevelStyleCompaction(SERVER_KNOBS->ROCKSDB_MEMTABLE_BYTES);
if (SERVER_KNOBS->ROCKSDB_PERIODIC_COMPACTION_SECONDS > 0) {
options.periodic_compaction_seconds = SERVER_KNOBS->ROCKSDB_PERIODIC_COMPACTION_SECONDS;
}
return options;
}

View File

@ -312,6 +312,7 @@ void ServerKnobs::initialize(bool randomize, ClientKnobs* clientKnobs, bool isSi
init( ROCKSDB_BACKGROUND_PARALLELISM, 0 );
init( ROCKSDB_MEMTABLE_BYTES, 512 * 1024 * 1024 );
init( ROCKSDB_UNSAFE_AUTO_FSYNC, false );
init( ROCKSDB_PERIODIC_COMPACTION_SECONDS, 0 );
// Leader election
bool longLeaderElection = randomize && BUGGIFY;

View File

@ -247,6 +247,7 @@ public:
int ROCKSDB_BACKGROUND_PARALLELISM;
int64_t ROCKSDB_MEMTABLE_BYTES;
bool ROCKSDB_UNSAFE_AUTO_FSYNC;
int64_t ROCKSDB_PERIODIC_COMPACTION_SECONDS;
// Leader election
int MAX_NOTIFICATIONS;