This is an automated email from the ASF dual-hosted git repository.
maplefu pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 698c3d4c feat(config): add the `partition_filters` option to disable
the partitioned filters (#2688)
698c3d4c is described below
commit 698c3d4cedb7321b70bb4b4b2bc0abc9cd8db337
Author: fukua95 <[email protected]>
AuthorDate: Fri Dec 6 17:06:08 2024 +0800
feat(config): add the `partition_filters` option to disable the partitioned
filters (#2688)
---
kvrocks.conf | 5 +++++
src/config/config.cc | 1 +
src/config/config.h | 1 +
src/storage/storage.cc | 2 +-
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/kvrocks.conf b/kvrocks.conf
index 84a08d25..16a980e5 100644
--- a/kvrocks.conf
+++ b/kvrocks.conf
@@ -1016,6 +1016,11 @@ rocksdb.write_options.memtable_insert_hint_per_batch no
# Default: yes
rocksdb.rate_limiter_auto_tuned yes
+# If enabled, rocksdb will use partitioned full filters for each SST file.
+#
+# Default: yes
+rocksdb.partition_filters yes
+
# Enable this option will schedule the deletion of obsolete files in a
background thread
# on iterator destruction. It can reduce the latency if there are many files
to be removed.
# see https://github.com/facebook/rocksdb/wiki/IO#avoid-blocking-io
diff --git a/src/config/config.cc b/src/config/config.cc
index b670c387..9d8e2a79 100644
--- a/src/config/config.cc
+++ b/src/config/config.cc
@@ -298,6 +298,7 @@ Config::Config() {
{"rocksdb.max_background_jobs", false, new
IntField(&rocks_db.max_background_jobs, 4, 0, 32)},
{"rocksdb.rate_limiter_auto_tuned", true, new
YesNoField(&rocks_db.rate_limiter_auto_tuned, true)},
{"rocksdb.avoid_unnecessary_blocking_io", true, new
YesNoField(&rocks_db.avoid_unnecessary_blocking_io, true)},
+ {"rocksdb.partition_filters", true, new
YesNoField(&rocks_db.partition_filters, true)},
/* rocksdb write options */
{"rocksdb.write_options.sync", true, new
YesNoField(&rocks_db.write_options.sync, false)},
diff --git a/src/config/config.h b/src/config/config.h
index 1e095bd1..9fa5d416 100644
--- a/src/config/config.h
+++ b/src/config/config.h
@@ -220,6 +220,7 @@ struct Config {
int max_background_jobs;
bool rate_limiter_auto_tuned;
bool avoid_unnecessary_blocking_io = true;
+ bool partition_filters;
struct WriteOptions {
bool sync;
diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index 39739a54..8e3140c4 100644
--- a/src/storage/storage.cc
+++ b/src/storage/storage.cc
@@ -136,7 +136,7 @@ rocksdb::BlockBasedTableOptions Storage::InitTableOptions()
{
table_options.format_version = 5;
table_options.index_type =
rocksdb::BlockBasedTableOptions::IndexType::kTwoLevelIndexSearch;
table_options.filter_policy.reset(rocksdb::NewBloomFilterPolicy(10, false));
- table_options.partition_filters = true;
+ table_options.partition_filters = config_->rocks_db.partition_filters;
table_options.optimize_filters_for_memory = true;
table_options.metadata_block_size = 4096;
table_options.data_block_index_type =
rocksdb::BlockBasedTableOptions::DataBlockIndexType::kDataBlockBinaryAndHash;