Skip to content

Commit e31c724

Browse files
committed
kv/RocksDBStore: Configure compact-on-deletion for all CFs
update_column_family_options() is called only for non-default CFs, whereas load_rocksdb_options() sets options for all CFs, including default. This isn't really a problem for new installs, where the default CF isn't used for very much, but for upgrades where resharding has not yet happened, the bulk of rocksdb data is still in the default CF and so it's important that it also gets compact-on-deletion configured, if desired. Fixes: https://tracker.ceph.com/issues/64511 Signed-off-by: Joshua Baergen <[email protected]>
1 parent fa5ef87 commit e31c724

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/kv/RocksDBStore.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,14 @@ int RocksDBStore::load_rocksdb_options(bool create_if_missing, rocksdb::Options&
585585
if (cct->_conf.get_val<Option::size_t>("rocksdb_metadata_block_size") > 0)
586586
bbt_opts.metadata_block_size = cct->_conf.get_val<Option::size_t>("rocksdb_metadata_block_size");
587587

588+
// Set Compact on Deletion Factory
589+
if (cct->_conf->rocksdb_cf_compact_on_deletion) {
590+
size_t sliding_window = cct->_conf->rocksdb_cf_compact_on_deletion_sliding_window;
591+
size_t trigger = cct->_conf->rocksdb_cf_compact_on_deletion_trigger;
592+
opt.table_properties_collector_factories.emplace_back(
593+
rocksdb::NewCompactOnDeletionCollectorFactory(sliding_window, trigger));
594+
}
595+
588596
opt.table_factory.reset(rocksdb::NewBlockBasedTableFactory(bbt_opts));
589597
dout(10) << __func__ << " block size " << cct->_conf->rocksdb_block_size
590598
<< ", block_cache size " << byte_u_t(block_cache_size)
@@ -934,14 +942,6 @@ int RocksDBStore::update_column_family_options(const std::string& base_name,
934942
return r;
935943
}
936944
}
937-
938-
// Set Compact on Deletion Factory
939-
if (cct->_conf->rocksdb_cf_compact_on_deletion) {
940-
size_t sliding_window = cct->_conf->rocksdb_cf_compact_on_deletion_sliding_window;
941-
size_t trigger = cct->_conf->rocksdb_cf_compact_on_deletion_trigger;
942-
cf_opt->table_properties_collector_factories.emplace_back(
943-
rocksdb::NewCompactOnDeletionCollectorFactory(sliding_window, trigger));
944-
}
945945
return 0;
946946
}
947947

0 commit comments

Comments
 (0)