git-hulk commented on code in PR #2850:
URL: https://github.com/apache/kvrocks/pull/2850#discussion_r2018070339
##########
src/cluster/cluster.cc:
##########
@@ -977,3 +991,13 @@ Status Cluster::Reset() {
unlink(srv_->GetConfig()->NodesFilePath().data());
return Status::OK();
}
+
+// Note that if current version is lower than the given version,
+// it can't be determined whether the node is in the cluster, so just regard
it as in the cluster.
+bool Cluster::IsInCluster(const std::string &node_id, int64_t version) const {
+ if (version < 0 || this->version_ < version) {
+ return true;
+ }
+
+ return nodes_->count(node_id) > 0;
+}
Review Comment:
```suggestion
}
```
##########
src/cluster/cluster_defs.h:
##########
@@ -41,6 +41,7 @@ inline constexpr const char *errNoMasterNode = "The node
isn't a master";
inline constexpr const char *errClusterNoInitialized = "The cluster is not
initialized";
inline constexpr const char *errInvalidClusterNodeInfo = "Invalid cluster
nodes info";
inline constexpr const char *errInvalidImportState = "Invalid import state";
+inline constexpr const char *errYouAreFired = "You are fired";
Review Comment:
I think it's not a right wording. Could be something like `disconnected due
to the topology change` or others.
--
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]