Ryan4253 commented on code in PR #3034:
URL: https://github.com/apache/kvrocks/pull/3034#discussion_r2177825446
##########
src/config/config.cc:
##########
@@ -728,6 +728,26 @@ void Config::initFieldCallback() {
srv->storage->SetSstFileDeleteRateBytesPerSecond(rocks_db.sst_file_delete_rate_bytes_per_sec);
return Status::OK();
}},
+ {"rocksdb.level0_slowdown_writes_trigger",
+ [this, &set_cf_option_cb](Server *srv, const std::string &k,
[[maybe_unused]] const std::string &v) -> Status {
+ if (rocks_db.level0_slowdown_writes_trigger == 0) {
+ return set_cf_option_cb(srv, k,
std::to_string(rocks_db.level0_stop_writes_trigger));
+ } else {
+ return set_cf_option_cb(srv, k,
std::to_string(rocks_db.level0_slowdown_writes_trigger));
+ }
+ }},
+ {"rocksdb.level0_stop_writes_trigger",
+ [this, &set_cf_option_cb](Server *srv, const std::string &k,
[[maybe_unused]] const std::string &v) -> Status {
+ if (rocks_db.level0_slowdown_writes_trigger == 0) {
+ Status s = set_cf_option_cb(srv,
"rocksdb.level0_slowdown_writes_trigger",
+
std::to_string(rocks_db.level0_stop_writes_trigger));
+ if (!s.IsOK()) {
+ return s;
+ }
+ }
+
+ return set_cf_option_cb(srv, k,
std::to_string(rocks_db.level0_stop_writes_trigger));
Review Comment:
Actually I am not too sure about what you mean by 1. Within the function
currently set_cf_option_cb would get called twice but it is called for two
different keys (slowdown and stop respectively). For 2 since the two have the
same limits, if setting the first one fails it would exit and nothing would be
set which I think matches what is intended.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]