perf(cubestore): enable bloom filter for metastore rocksdb reads#11083
perf(cubestore): enable bloom filter for metastore rocksdb reads#11083waralexrom wants to merge 1 commit into
Conversation
Add whole-key + prefix bloom filters to the metastore RocksDB block-based table options (open_db and open_readonly_db). The hot read path is whole-key point-gets (RowKey::Table(table_id, id)), so set_whole_key_filtering is enabled alongside the default prefix bloom from the fixed_prefix(13) extractor. Read-path only: no on-disk key format or table/index VERSION change, so an existing store opens without rebuild/reindex/migration. Blooms are per-SST and materialize lazily on flush/compaction; existing SSTs read fine without one.
|
Claude finished @waralexrom's task in 1m 12s —— View job ReviewVerdict: LGTM. The change is correctly scoped, the rationale is sound, and the compatibility story holds. Details — analysis, notes, minor suggestionsCorrectness
Performance / operational notes (non-blocking)
Scope check
Nothing else jumped out. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11083 +/- ##
=======================================
Coverage 58.50% 58.50%
=======================================
Files 216 216
Lines 17270 17270
Branches 3524 3524
=======================================
Hits 10103 10103
Misses 6652 6652
Partials 515 515
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Speeds up CubeStore metastore RocksDB point-gets by enabling bloom filters. Under load (mass pre-aggregation imports → huge partition/chunk space), the metastore coordinator does many
get_row(id)point lookups that hit disk; bloom filters let RocksDB skip SSTs that can't contain a key.Changes
set_bloom_filter(10.0, false)+set_whole_key_filtering(true)to the metastoreBlockBasedOptionsin bothopen_dbandopen_readonly_db(metastore/mod.rs).fixed_prefix(13)extractor is already set, so by default this yields a prefix bloom; the hot path is whole-key point-gets (RowKey::Table(table_id, id)), so whole-key filtering is enabled too.Compatibility
Read-path / open-time options only: no on-disk key format or table/index VERSION change, so an existing store opens without rebuild/reindex/migration. Blooms are per-SST and materialize lazily on flush/compaction — existing SSTs read fine without one (a one-time online
compact_rangewould give immediate full coverage but is not required).Testing
cargo build -p cubestore— green.cargo test -p cubestore metastore::— 28 passed, 0 failed (DB open + round-trip, snapshots, cold start, log replay).