PragmaTwice commented on code in PR #2020:
URL: https://github.com/apache/kvrocks/pull/2020#discussion_r1452108413
##########
src/server/server.cc:
##########
@@ -1839,6 +1844,26 @@ void Server::cleanupExitedWorkerThreads(bool force) {
}
}
+Status Server::overrideClusterMode() {
+ std::string value;
+ auto cf = storage->GetCFHandle(engine::kPropagateColumnFamilyName);
+ rocksdb::Status check_cluster_enabled =
+ storage->Get(rocksdb::ReadOptions(), cf,
rocksdb::Slice(engine::kClusterEnabledKey), &value);
+
+ if (check_cluster_enabled.IsNotFound()) {
+ return storage->WriteToPropagateCF(engine::kClusterEnabledKey,
std::to_string(config_->cluster_enabled));
+ }
+ if (check_cluster_enabled.ok()) {
+ if (config_->cluster_enabled != stoi(value)) {
+ LOG(ERROR) << "cluster_enable status from config file is inconsistent
with the persisted one";
+ return {Status::NotOK, "mismatching cluster_enable status"};
Review Comment:
```suggestion
return {Status::NotOK, "mismatched cluster_enabled status"};
```
--
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]