Skip to content

Commit

Permalink
feat: add a config of periodic_compaction_seconds in rocksdb (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongChaoqiang authored Jun 28, 2022
1 parent 6d28e35 commit 6d4d8b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@
# format_version=5. This provides a smooth path for automatic adoption over time, with an
# option for early opt-in.
rocksdb_format_version = 2
# default of periodic_compaction_seconds is disabled
rocksdb_periodic_compaction_seconds = 0

# 3000, 30MB, 1000, 30s
rocksdb_multi_get_max_iteration_count = 3000
Expand Down
6 changes: 6 additions & 0 deletions src/server/pegasus_server_impl_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,12 @@ pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
_key_ttl_compaction_filter_factory = std::make_shared<KeyWithTTLCompactionFilterFactory>();
_data_cf_opts.compaction_filter_factory = _key_ttl_compaction_filter_factory;

_data_cf_opts.periodic_compaction_seconds =
dsn_config_get_value_uint64("pegasus.server",
"rocksdb_periodic_compaction_seconds",
0,
"periodic_compaction_seconds, 0 means no periodic compaction");

// get the checkpoint reserve options.
_checkpoint_reserve_min_count_in_config = (uint32_t)dsn_config_get_value_uint64(
"pegasus.server", "checkpoint_reserve_min_count", 2, "checkpoint_reserve_min_count");
Expand Down

0 comments on commit 6d4d8b6

Please sign in to comment.