Knobs to speed up DB open. (#10301)

This commit is contained in:
Yao Xiao 2023-05-22 16:21:05 -07:00 committed by GitHub
parent 9bc55f67c3
commit bbf15be05f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -527,6 +527,8 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi
init (ROCKSDB_CF_METRICS_DELAY, 900.0 );
init (ROCKSDB_MAX_LOG_FILE_SIZE, 10485760 ); // 10MB.
init (ROCKSDB_KEEP_LOG_FILE_NUM, 200 ); // Keeps 2GB log per storage server.
init (ROCKSDB_SKIP_STATS_UPDATE_ON_OPEN, false ); if (isSimulated) ROCKSDB_SKIP_STATS_UPDATE_ON_OPEN = deterministicRandom()->coinflip();
init (ROCKSDB_SKIP_FILE_SIZE_CHECK_ON_OPEN, false ); if (isSimulated) ROCKSDB_SKIP_FILE_SIZE_CHECK_ON_OPEN = deterministicRandom()->coinflip();
// Leader election
bool longLeaderElection = randomize && BUGGIFY;

View File

@ -470,6 +470,8 @@ public:
double ROCKSDB_CF_METRICS_DELAY;
int ROCKSDB_MAX_LOG_FILE_SIZE;
int ROCKSDB_KEEP_LOG_FILE_NUM;
bool ROCKSDB_SKIP_STATS_UPDATE_ON_OPEN;
bool ROCKSDB_SKIP_FILE_SIZE_CHECK_ON_OPEN;
// Leader election
int MAX_NOTIFICATIONS;

View File

@ -477,6 +477,9 @@ rocksdb::Options getOptions() {
}
options.max_log_file_size = SERVER_KNOBS->ROCKSDB_MAX_LOG_FILE_SIZE;
options.keep_log_file_num = SERVER_KNOBS->ROCKSDB_KEEP_LOG_FILE_NUM;
options.skip_stats_update_on_db_open = SERVER_KNOBS->ROCKSDB_SKIP_STATS_UPDATE_ON_OPEN;
options.skip_checking_sst_file_sizes_on_db_open = SERVER_KNOBS->ROCKSDB_SKIP_FILE_SIZE_CHECK_ON_OPEN;
return options;
}