acelyc111 commented on code in PR #1651:
URL:
https://github.com/apache/incubator-pegasus/pull/1651#discussion_r1365260615
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -1667,7 +1667,18 @@ dsn::error_code pegasus_server_impl::start(int argc,
char **argv)
// only be initialized with default values when calling
'LoadLatestOptions', see
// 'rocksdb/utilities/options_util.h'.
reset_rocksdb_options(loaded_data_cf_opts, &_table_data_cf_opts);
- _db_opts.allow_ingest_behind = parse_allow_ingest_behind(envs);
+
+ // here loaded_db_opt should be read success
+ if (envs.size() == 0) {
+ // for reopen db during load balance learning
+ _db_opts.allow_ingest_behind =
loaded_db_opt.allow_ingest_behind;
+ LOG_INFO_PREFIX("reopen replica,last_allow_ingest_behind = {}",
Review Comment:
We can check the real configs in rocksdb's own log, it's not necessary to
print log for every config, line 1679 is the same.
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -1667,7 +1667,18 @@ dsn::error_code pegasus_server_impl::start(int argc,
char **argv)
// only be initialized with default values when calling
'LoadLatestOptions', see
// 'rocksdb/utilities/options_util.h'.
reset_rocksdb_options(loaded_data_cf_opts, &_table_data_cf_opts);
- _db_opts.allow_ingest_behind = parse_allow_ingest_behind(envs);
+
+ // here loaded_db_opt should be read success
+ if (envs.size() == 0) {
Review Comment:
```suggestion
if (envs.empty()) {
```
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -1667,7 +1667,18 @@ dsn::error_code pegasus_server_impl::start(int argc,
char **argv)
// only be initialized with default values when calling
'LoadLatestOptions', see
// 'rocksdb/utilities/options_util.h'.
reset_rocksdb_options(loaded_data_cf_opts, &_table_data_cf_opts);
- _db_opts.allow_ingest_behind = parse_allow_ingest_behind(envs);
+
+ // here loaded_db_opt should be read success
Review Comment:
nit: Remove this verbose comment.
##########
src/server/pegasus_server_impl.cpp:
##########
@@ -1667,7 +1667,18 @@ dsn::error_code pegasus_server_impl::start(int argc,
char **argv)
// only be initialized with default values when calling
'LoadLatestOptions', see
// 'rocksdb/utilities/options_util.h'.
reset_rocksdb_options(loaded_data_cf_opts, &_table_data_cf_opts);
- _db_opts.allow_ingest_behind = parse_allow_ingest_behind(envs);
+
+ // here loaded_db_opt should be read success
+ if (envs.size() == 0) {
+ // for reopen db during load balance learning
+ _db_opts.allow_ingest_behind =
loaded_db_opt.allow_ingest_behind;
+ LOG_INFO_PREFIX("reopen replica,last_allow_ingest_behind = {}",
+ loaded_db_opt.allow_ingest_behind);
+ } else {
+ _db_opts.allow_ingest_behind = parse_allow_ingest_behind(envs);
Review Comment:
Would you mind to refactor the code to encapsulate configs updating of
`_db_opts` to `reset_rocksdb_options()` as well?
--
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]