Merge pull request #6795 from neethuhaneesha/rocksdb-blocksize

Adding rocksdb block size option.
This commit is contained in:
neethuhaneesha 2022-04-08 14:20:54 -07:00 committed by GitHub
commit b7096c410f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -388,6 +388,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi
init( ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD, 1 );
init( ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD, 5 );
init( ROCKSDB_COMPACTION_READAHEAD_SIZE, 32768 ); // 32 KB, performs bigger reads when doing compaction.
init( ROCKSDB_BLOCK_SIZE, 32768 ); // 32 KB, size of the block in rocksdb cache.
// Leader election
bool longLeaderElection = randomize && BUGGIFY;

View File

@ -318,6 +318,7 @@ public:
int ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD;
int ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD;
int64_t ROCKSDB_COMPACTION_READAHEAD_SIZE;
int64_t ROCKSDB_BLOCK_SIZE;
// Leader election
int MAX_NOTIFICATIONS;

View File

@ -294,6 +294,9 @@ rocksdb::ColumnFamilyOptions getCFOptions() {
}
bbOpts.block_cache = rocksdb_block_cache;
}
if (SERVER_KNOBS->ROCKSDB_BLOCK_SIZE > 0) {
bbOpts.block_size = SERVER_KNOBS->ROCKSDB_BLOCK_SIZE;
}
options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(bbOpts));