Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv/RocksDBStore: Configure compact-on-deletion for all CFs #55676

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/kv/RocksDBStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,14 @@ int RocksDBStore::load_rocksdb_options(bool create_if_missing, rocksdb::Options&
if (cct->_conf.get_val<Option::size_t>("rocksdb_metadata_block_size") > 0)
bbt_opts.metadata_block_size = cct->_conf.get_val<Option::size_t>("rocksdb_metadata_block_size");

// Set Compact on Deletion Factory
if (cct->_conf->rocksdb_cf_compact_on_deletion) {
size_t sliding_window = cct->_conf->rocksdb_cf_compact_on_deletion_sliding_window;
size_t trigger = cct->_conf->rocksdb_cf_compact_on_deletion_trigger;
opt.table_properties_collector_factories.emplace_back(
rocksdb::NewCompactOnDeletionCollectorFactory(sliding_window, trigger));
}

opt.table_factory.reset(rocksdb::NewBlockBasedTableFactory(bbt_opts));
dout(10) << __func__ << " block size " << cct->_conf->rocksdb_block_size
<< ", block_cache size " << byte_u_t(block_cache_size)
Expand Down Expand Up @@ -934,14 +942,6 @@ int RocksDBStore::update_column_family_options(const std::string& base_name,
return r;
}
}

// Set Compact on Deletion Factory
if (cct->_conf->rocksdb_cf_compact_on_deletion) {
size_t sliding_window = cct->_conf->rocksdb_cf_compact_on_deletion_sliding_window;
size_t trigger = cct->_conf->rocksdb_cf_compact_on_deletion_trigger;
cf_opt->table_properties_collector_factories.emplace_back(
rocksdb::NewCompactOnDeletionCollectorFactory(sliding_window, trigger));
}
return 0;
}

Expand Down
Loading