Skip to content

feat: add RocksDB Cloud bloom filter config#481

Open
thweetkomputer wants to merge 2 commits into
mainfrom
rocksdb-cloud-bloom-filter
Open

feat: add RocksDB Cloud bloom filter config#481
thweetkomputer wants to merge 2 commits into
mainfrom
rocksdb-cloud-bloom-filter

Conversation

@thweetkomputer

@thweetkomputer thweetkomputer commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Here are some reminders before you submit the pull request

  • Add tests for the change
  • Document changes
  • Reference the link of issue using fixes eloqdb/tx_service#issue_id
  • Reference the link of RFC if exists
  • Pass ./mtr --suite=mono_main,mono_multi,mono_basic

Summary by CodeRabbit

  • New Features

    • Added Bloom filter support for RocksDB Cloud storage with options to enable filtering and tune bits-per-key for performance.
  • Documentation

    • Updated RocksDB configuration docs to describe the new Bloom filter settings, defaults, and configuration examples.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4a9310ab-8e03-4836-9030-10a620dafadc

📥 Commits

Reviewing files that changed from the base of the PR and between 8ab5e85 and 33a7275.

📒 Files selected for processing (1)
  • store_handler/eloq_data_store_service/rocksdb_cloud_data_store.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • store_handler/eloq_data_store_service/rocksdb_cloud_data_store.cpp

Walkthrough

This PR adds Bloom filter support to RocksDB Cloud databases. Two new configuration flags control whether Bloom filtering is enabled and set its bits-per-key tuning parameter. The configuration is loaded from command-line flags or INI files, applied during database initialization, and documented with examples and value format requirements.

Changes

Bloom Filter Configuration

Layer / File(s) Summary
Configuration Data Structure
store_handler/eloq_data_store_service/rocksdb_config.h
RocksDBCloudConfig adds enable_bloom_filter_ (bool, default false) and bloom_filter_bits_per_key_ (double, default 10.0) member fields.
Flag Definition and Loading
store_handler/eloq_data_store_service/rocksdb_config.cpp
New gflags rocksdb_cloud_enable_bloom_filter and rocksdb_cloud_bloom_filter_bits_per_key are defined and loaded from command-line overrides or the [store] INI section into config instance fields.
Bloom Filter Application
store_handler/eloq_data_store_service/rocksdb_cloud_data_store.cpp
Header rocksdb/filter_policy.h is included. In OpenCloudDB, when enable_bloom_filter_ is true, BlockBasedTableOptions is configured with NewBloomFilterPolicy (using bits_per_key) with whole-key filtering enabled, then installed as options.table_factory.
Configuration Documentation
store_handler/eloq_data_store_service/RocksDB_Configuration_Flags.md
Documentation for both new flags and their defaults is added with an INI example. "Real Number Flags" format rule is added to Value Format Requirements to document support for numeric values like 10 and 9.5.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Bloom filters bloom in RocksDB's care,
Bits per key, a tuning pair,
Flags and INI lines now sing in tune,
New SST files hum beneath the moon,
Hop, configure, and store with flair!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description consists only of an uncompleted checklist template with no substantive information about the changes, objectives, or rationale for the feature. Fill in the checklist items to indicate which were completed (tests added, documentation updated, issues/RFCs referenced) and provide context about the bloom filter configuration feature being added.
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main feature being added: RocksDB Cloud bloom filter configuration support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rocksdb-cloud-bloom-filter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
store_handler/eloq_data_store_service/rocksdb_config.cpp (1)

599-622: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate that bloom_filter_bits_per_key is positive.

The code reads bloom_filter_bits_per_key from configuration but doesn't validate that it's a positive value. Negative or zero values could lead to unexpected behavior when creating the bloom filter policy.

🛡️ Proposed fix to add validation
 double rocksdb_cloud_bloom_filter_bits_per_key =
     !CheckCommandLineFlagIsDefault(
         "rocksdb_cloud_bloom_filter_bits_per_key")
         ? FLAGS_rocksdb_cloud_bloom_filter_bits_per_key
         : config.GetReal("store",
                          "rocksdb_cloud_bloom_filter_bits_per_key",
                          FLAGS_rocksdb_cloud_bloom_filter_bits_per_key);
+
+if (rocksdb_cloud_bloom_filter_bits_per_key <= 0)
+{
+    LOG(ERROR) << "Invalid rocksdb_cloud_bloom_filter_bits_per_key: "
+               << rocksdb_cloud_bloom_filter_bits_per_key
+               << ". Must be positive. Using default value 10.";
+    rocksdb_cloud_bloom_filter_bits_per_key = 10;
+}

 sst_file_cache_size_ =
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@store_handler/eloq_data_store_service/rocksdb_config.cpp` around lines 599 -
622, Validate that rocksdb_cloud_bloom_filter_bits_per_key is > 0 before
assigning it to bloom_filter_bits_per_key_; if it is <= 0, log a warning and
replace it with a safe default (e.g.,
FLAGS_rocksdb_cloud_bloom_filter_bits_per_key or 1) so the subsequent use of
bloom_filter_bits_per_key_ cannot receive non-positive values; update the
assignment that sets bloom_filter_bits_per_key_ =
rocksdb_cloud_bloom_filter_bits_per_key to perform this check and fallback,
using the existing config/flag variables and process logger for the warning.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@store_handler/eloq_data_store_service/rocksdb_config.cpp`:
- Around line 599-622: Validate that rocksdb_cloud_bloom_filter_bits_per_key is
> 0 before assigning it to bloom_filter_bits_per_key_; if it is <= 0, log a
warning and replace it with a safe default (e.g.,
FLAGS_rocksdb_cloud_bloom_filter_bits_per_key or 1) so the subsequent use of
bloom_filter_bits_per_key_ cannot receive non-positive values; update the
assignment that sets bloom_filter_bits_per_key_ =
rocksdb_cloud_bloom_filter_bits_per_key to perform this check and fallback,
using the existing config/flag variables and process logger for the warning.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5075678a-a1cd-4c65-b700-7101236f946f

📥 Commits

Reviewing files that changed from the base of the PR and between 64554e4 and 8ab5e85.

📒 Files selected for processing (4)
  • store_handler/eloq_data_store_service/RocksDB_Configuration_Flags.md
  • store_handler/eloq_data_store_service/rocksdb_cloud_data_store.cpp
  • store_handler/eloq_data_store_service/rocksdb_config.cpp
  • store_handler/eloq_data_store_service/rocksdb_config.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant