Skip to content

Commit

Permalink
fix units
Browse files Browse the repository at this point in the history
  • Loading branch information
jjz921024 committed Apr 26, 2024
1 parent 253873b commit 9462a2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions kvrocks.conf
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ json-storage-format json
# including pubsub, propagte, zset_score, stream and search.
# It will reduce the memory usage in some scenarios.
#
# Default: 64MB
minor-columns-write-buffer-size 64
# Default: 65536 KB (same with rocksdb.write_buffer_size)
minor-columns-write-buffer-size 65536

################################## TLS ###################################

Expand Down
4 changes: 2 additions & 2 deletions src/config/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Config::Config() {
{"json-max-nesting-depth", false, new IntField(&json_max_nesting_depth, 1024, 0, INT_MAX)},
{"json-storage-format", false,
new EnumField<JsonStorageFormat>(&json_storage_format, json_storage_formats, JsonStorageFormat::JSON)},
{"minor-columns-write-buffer-size", false, new IntField(&minor_columns_write_buffer_size, 64, 0, 4096)},
{"minor-columns-write-buffer-size", false, new IntField(&minor_columns_write_buffer_size, 16, 0, 4194304)},

/* rocksdb options */
{"rocksdb.compression", false,
Expand Down Expand Up @@ -585,7 +585,7 @@ void Config::initFieldCallback() {
kColumnFamilyIDSearch};
for (const auto &cf : column_families) {
auto s = srv->storage->SetOptionForColumnFamily(cf, "write_buffer_size",
std::to_string(minor_columns_write_buffer_size * MiB));
std::to_string(minor_columns_write_buffer_size * KiB));
if (!s.IsOK()) return s;
}
return Status::OK();
Expand Down
6 changes: 3 additions & 3 deletions src/storage/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ Status Storage::Open(DBOpenMode mode) {
SetBlobDB(&propagate_opts);

rocksdb::ColumnFamilyOptions minor_opts(subkey_opts);
minor_opts.write_buffer_size = config_->minor_columns_write_buffer_size;
pubsub_opts.write_buffer_size = config_->minor_columns_write_buffer_size;
propagate_opts.write_buffer_size = config_->minor_columns_write_buffer_size;
minor_opts.write_buffer_size = config_->minor_columns_write_buffer_size * KiB;
pubsub_opts.write_buffer_size = config_->minor_columns_write_buffer_size * KiB;
propagate_opts.write_buffer_size = config_->minor_columns_write_buffer_size * KiB;

std::vector<rocksdb::ColumnFamilyDescriptor> column_families;
// Caution: don't change the order of column family, or the handle will be mismatched
Expand Down

0 comments on commit 9462a2a

Please sign in to comment.