Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix several mismatching default option values and their comments #1664

Merged
merged 11 commits into from
Aug 11, 2023
8 changes: 4 additions & 4 deletions kvrocks.conf
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ rocksdb.row_cache_size 0
# files opened are always kept open. You can estimate number of files based
# on target_file_size_base and target_file_size_multiplier for level-based
# compaction. For universal-style compaction, you can usually set it to -1.
# Default: 4096
# Default: 8096
torwig marked this conversation as resolved.
Show resolved Hide resolved
rocksdb.max_open_files 8096

# Amount of data to build up in memory (backed by an unsorted log
Expand Down Expand Up @@ -603,7 +603,7 @@ 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.
# Default: 2 (i.e. no subcompactions)
# Default: 2
torwig marked this conversation as resolved.
Show resolved Hide resolved
rocksdb.max_sub_compactions 2

# In order to limit the size of WALs, RocksDB uses DBOptions::max_total_wal_size
Expand Down Expand Up @@ -647,12 +647,12 @@ rocksdb.wal_size_limit_mb 16384
# actual size of the unit read from disk may be smaller if
# compression is enabled.
#
# Default: 4KB
# Default: 16KB
torwig marked this conversation as resolved.
Show resolved Hide resolved
rocksdb.block_size 16384

# Indicating if we'd put index/filter blocks to the block cache
#
# Default: no
# Default: yes
rocksdb.cache_index_and_filter_blocks yes

# Specify the compression to use. Only compress level greater
Expand Down
8 changes: 4 additions & 4 deletions src/config/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "server/server.h"
#include "status.h"

constexpr const char *kDefaultBindAddress = "127.0.0.1";
constexpr const char *kDefaultBindAddress = "0.0.0.0";

constexpr const char *errBlobDbNotEnabled = "Must set rocksdb.enable_blob_files to yes first.";
constexpr const char *errLevelCompactionDynamicLevelBytesNotSet =
Expand Down Expand Up @@ -162,14 +162,14 @@ Config::Config() {
/* rocksdb options */
{"rocksdb.compression", false,
new EnumField(&rocks_db.compression, compression_types, rocksdb::CompressionType::kNoCompression)},
{"rocksdb.block_size", true, new IntField(&rocks_db.block_size, 4096, 0, INT_MAX)},
{"rocksdb.max_open_files", false, new IntField(&rocks_db.max_open_files, 4096, -1, INT_MAX)},
{"rocksdb.block_size", true, new IntField(&rocks_db.block_size, 16384, 0, INT_MAX)},
{"rocksdb.max_open_files", false, new IntField(&rocks_db.max_open_files, 8096, -1, INT_MAX)},
{"rocksdb.write_buffer_size", false, new IntField(&rocks_db.write_buffer_size, 64, 0, 4096)},
{"rocksdb.max_write_buffer_number", false, new IntField(&rocks_db.max_write_buffer_number, 4, 0, 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_sub_compactions", false, new IntField(&rocks_db.max_sub_compactions, 1, 0, 16)},
{"rocksdb.max_sub_compactions", false, new IntField(&rocks_db.max_sub_compactions, 2, 0, 16)},
{"rocksdb.delayed_write_rate", false, new Int64Field(&rocks_db.delayed_write_rate, 0, 0, INT64_MAX)},
{"rocksdb.wal_ttl_seconds", true, new IntField(&rocks_db.wal_ttl_seconds, 3 * 3600, 0, INT_MAX)},
{"rocksdb.wal_size_limit_mb", true, new IntField(&rocks_db.wal_size_limit_mb, 16384, 0, INT_MAX)},
Expand Down