This is an automated email from the ASF dual-hosted git repository.
hulk 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 b7423c480 chore(config): remove the deprecated configuration
`rocksdb.max_background_{compactions,flushes}` and set default to -1 (#3398)
b7423c480 is described below
commit b7423c48042b272958d3f036b04f729c717fb7c4
Author: Yatrik Solanki <[email protected]>
AuthorDate: Tue Mar 24 12:37:51 2026 -0400
chore(config): remove the deprecated configuration
`rocksdb.max_background_{compactions,flushes}` and set default to -1 (#3398)
This PR will:
- update the default values of `rocksdb.max_background_compactions` and
`rocksdb.max_background_flushes` from `2` to `-1`
- unset them from `kvrocks.conf` and update comments to reflect
RocksDB's decision logic for max background threads
NOTE: This doesn't make it so that `rocksdb.max_background_compactions`
is unsettable, like `rocksdb.max_background_flushes` currently is. This
may be desirable for people who do currently use the old overrides, but
afaik it would lock people in to `max_background_flushes = 2` - but
that's already the case as far as I can tell.
I ran each of:
```
./x.py format (unrelated changes)
./x.py build --unittest
./x.py test cpp
```
Tests all pass and formatting changes are unrelated.
This is effectively an addition to
https://github.com/apache/kvrocks/issues/1665
See https://github.com/apache/kvrocks/discussions/3395 for more
background.
---------
Co-authored-by: Yatrik S. <[email protected]>
Co-authored-by: Aleks Lozovyuk <[email protected]>
Co-authored-by: hulk <[email protected]>
---
kvrocks.conf | 18 ++----------------
src/config/config.cc | 4 ++--
2 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/kvrocks.conf b/kvrocks.conf
index a4180cde1..12add2d19 100644
--- a/kvrocks.conf
+++ b/kvrocks.conf
@@ -820,24 +820,10 @@ rocksdb.min_write_buffer_number_to_merge 1
# Maximum number of concurrent background jobs (compactions and flushes).
-# For backwards compatibility we will set `max_background_jobs =
-# max_background_compactions + max_background_flushes` in the case where user
-# sets at least one of `max_background_compactions` or `max_background_flushes`
-# (we replace -1 by 1 in case one option is unset).
+# By default, rocksdb will set max_background_flushes to
floor(max_background_jobs / 4),
+# and allocate the rest to compactions.
rocksdb.max_background_jobs 4
-# DEPRECATED: it is automatically decided based on the value of
rocksdb.max_background_jobs
-# Maximum number of concurrent background compaction jobs, submitted to
-# the default LOW priority thread pool.
-rocksdb.max_background_compactions -1
-
-# DEPRECATED: it is automatically decided based on the value of
rocksdb.max_background_jobs
-# Maximum number of concurrent background memtable flush jobs, submitted by
-# default to the HIGH priority thread pool. If the HIGH priority thread pool
-# is configured to have zero threads, flush jobs will share the LOW priority
-# thread pool with compaction jobs.
-rocksdb.max_background_flushes -1
-
# This value represents the maximum number of threads that will
# concurrently perform a compaction job by breaking it into multiple,
# smaller ones that are run simultaneously.
diff --git a/src/config/config.cc b/src/config/config.cc
index 316948091..55dada9cf 100644
--- a/src/config/config.cc
+++ b/src/config/config.cc
@@ -262,8 +262,8 @@ Config::Config() {
{"rocksdb.min_write_buffer_number_to_merge", false,
new IntField(&rocks_db.min_write_buffer_number_to_merge, 1, 1, 256)},
{"rocksdb.target_file_size_base", false, new
IntField(&rocks_db.target_file_size_base, 128, 1, 1024)},
- {"rocksdb.max_background_compactions", false, new
IntField(&rocks_db.max_background_compactions, 2, -1, 32)},
- {"rocksdb.max_background_flushes", true, new
IntField(&rocks_db.max_background_flushes, 2, -1, 32)},
+ {"rocksdb.max_background_compactions", false, new
IntField(&rocks_db.max_background_compactions, -1, -1, 32)},
+ {"rocksdb.max_background_flushes", true, new
IntField(&rocks_db.max_background_flushes, -1, -1, 32)},
{"rocksdb.max_subcompactions", false, new
IntField(&rocks_db.max_subcompactions, 2, 0, 16)},
{"rocksdb.delayed_write_rate", false, new
Int64Field(&rocks_db.delayed_write_rate, 0, 0, INT64_MAX)},
{"rocksdb.wal_compression", true,