ruojieranyishen commented on code in PR #1511:
URL:
https://github.com/apache/incubator-pegasus/pull/1511#discussion_r1227471982
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -2625,6 +2626,61 @@ pegasus_server_impl::get_restore_dir_from_env(const
std::map<std::string, std::s
return res;
}
+void pegasus_server_impl::update_rocksdb_dynamic_options(
+ const std::map<std::string, std::string> &envs)
+{
+ if (envs.size() == 0)
+ return;
+
+ std::unordered_map<std::string, std::string> new_options;
+ for (auto &option : ROCKSDB_DYNAMIC_OPTIONS) {
+ auto find = envs.find(option);
+ if (option.compare(ROCKSDB_WRITE_BUFFER_SIZE) == 0 && find !=
envs.end()) {
+ new_options["write_buffer_size"] = find->second;
+ }
+ }
+
+ // doing set option
+ if (new_options.size() != 0 && !set_options(new_options)) {
+ LOG_WARNING("Set options fails");
Review Comment:
This is due to detailed error messages in the `set_options` function. In
order to avoid repeated errors, I will change to the following code.
```c++
if (new_options.size() >0 && set_options(new_options)) {
LOG_INFO("Set rocksdb dynamic options success");
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]