neverchanje commented on a change in pull request #593:
URL: https://github.com/apache/incubator-pegasus/pull/593#discussion_r483464994
##########
File path: src/server/pegasus_server_impl.cpp
##########
@@ -1344,28 +1353,28 @@ ::dsn::error_code pegasus_server_impl::start(int argc,
char **argv)
&loaded_cf_descs,
/*ignore_unknown_options=*/true);
if (!status.ok()) {
- derror_replica("load latest option file failed.");
- return ::dsn::ERR_LOCAL_APP_FAILURE;
- }
- for (int i = 0; i < loaded_cf_descs.size(); ++i) {
- if (loaded_cf_descs[i].name == META_COLUMN_FAMILY_NAME) {
- missing_meta_cf = false;
- } else if (loaded_cf_descs[i].name == DATA_COLUMN_FAMILY_NAME) {
- missing_data_cf = false;
- loaded_data_cf_opts = loaded_cf_descs[i].options;
- } else {
- derror_replica("unknown column family name.");
+ if (status.ToString().find("pegasus") == std::string::npos) {
+ derror_replica("load latest option file failed: {}.",
status.ToString());
return ::dsn::ERR_LOCAL_APP_FAILURE;
}
Review comment:
```suggestion
if (status.code() != rocksdb::Status::kInvalidArgument ||
status.ToString().find(" Unrecognized option") == std::string::npos) {
derror_replica("load latest option file failed: {}.",
status.ToString());
return ::dsn::ERR_LOCAL_APP_FAILURE;
}
```
##########
File path: src/server/pegasus_server_impl.cpp
##########
@@ -1344,28 +1353,28 @@ ::dsn::error_code pegasus_server_impl::start(int argc,
char **argv)
&loaded_cf_descs,
/*ignore_unknown_options=*/true);
if (!status.ok()) {
- derror_replica("load latest option file failed.");
- return ::dsn::ERR_LOCAL_APP_FAILURE;
- }
- for (int i = 0; i < loaded_cf_descs.size(); ++i) {
- if (loaded_cf_descs[i].name == META_COLUMN_FAMILY_NAME) {
- missing_meta_cf = false;
- } else if (loaded_cf_descs[i].name == DATA_COLUMN_FAMILY_NAME) {
- missing_data_cf = false;
- loaded_data_cf_opts = loaded_cf_descs[i].options;
- } else {
- derror_replica("unknown column family name.");
+ if (status.ToString().find("pegasus") == std::string::npos) {
+ derror_replica("load latest option file failed: {}.",
status.ToString());
return ::dsn::ERR_LOCAL_APP_FAILURE;
}
Review comment:
```suggestion
if (status.code() != rocksdb::Status::kInvalidArgument ||
status.ToString().find("Unrecognized option") == std::string::npos) {
derror_replica("load latest option file failed: {}.",
status.ToString());
return ::dsn::ERR_LOCAL_APP_FAILURE;
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]