WHBANG commented on code in PR #1108:
URL: https://github.com/apache/incubator-pegasus/pull/1108#discussion_r944218454
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -3007,6 +3013,97 @@ void pegasus_server_impl::reset_usage_scenario_options(
target_opts->max_write_buffer_number = base_opts.max_write_buffer_number;
}
+void pegasus_server_impl::recalculate_data_cf_options(
+ const rocksdb::ColumnFamilyOptions &cur_data_cf_opts)
+{
+#define UPDATE_OPTION_IF_NEEDED(option, value, str_value)
\
+ if ((value) != cur_data_cf_opts.option) {
\
+ new_options[#option] = (str_value);
\
+ }
Review Comment:
`if (_data_cf_opts.option != cur_data_cf_opts.option) { ` is wrong
use level0_file_num_compaction_trigger as an example:
1. start_onebox, do not change the config template
```
cur_data_cf_opts.level0_file_num_compaction_trigger = 4
_data_cf_opts.level0_file_num_compaction_trigger = 4
```
2. set `usage scenario`is `bulk load`
```
cur_data_cf_opts.level0_file_num_compaction_trigger = 1000000000
_data_cf_opts.level0_file_num_compaction_trigger = 4
```
3. restart the db, will call LoadLatestOptions()
```
cur_data_cf_opts.level0_file_num_compaction_trigger = 1000000000
_data_cf_opts.level0_file_num_compaction_trigger = 4
```
At this time `_data_cf_opts.option != cur_data_cf_opts.option`, but in fact
the value of option is correct, nothing needs to be done, so need `(value) !=
cur_data_cf_opts.option) `
--
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]