You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "git-hulk (via GitHub)" <gi...@apache.org> on 2023/07/28 13:59:22 UTC
[GitHub] [kvrocks] git-hulk commented on a diff in pull request #1615: Fix data race when updating the slots_info string
git-hulk commented on code in PR #1615:
URL: https://github.com/apache/kvrocks/pull/1615#discussion_r1277579754
##########
src/cluster/cluster.cc:
##########
@@ -495,22 +495,22 @@ std::string Cluster::genNodesDescription() {
// Ping sent, pong received, config epoch, link status
node_str.append(fmt::format("{} {} {} connected", now - 1, now, version_));
- if (n->role == kClusterMaster && n->slots_info.size() > 0) {
- node_str.append(" " + n->slots_info);
+ if (n->role == kClusterMaster) {
+ auto iter = slots_infos.find(n->id);
+ if (iter != slots_infos.end() && iter->second.size() > 0) {
+ node_str.append(" " + iter->second);
+ }
}
nodes_desc.append(node_str + "\n");
}
return nodes_desc;
}
-void Cluster::updateSlotsInfo() {
+std::map<std::string, std::string> Cluster::getClusterNodeSlots() {
Review Comment:
sure, won't expect to change outside
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org