git-hulk commented on code in PR #271:
URL:
https://github.com/apache/kvrocks-controller/pull/271#discussion_r2016766362
##########
controller/cluster.go:
##########
@@ -228,11 +235,40 @@ func (c *ClusterChecker) parallelProbeNodes(ctx
context.Context, cluster *store.
zap.Int64("node.version",
version),
zap.Int64("clusterName.version", clusterVersion),
).Warn("The node is in a higher
version")
+ mu.Lock()
+ if version > latestNodeVersion {
+ clusterNodesStr, errX :=
n.GetClusterNodesString(ctx)
+ if errX != nil {
+
log.With(zap.String("node", n.ID()), zap.Error(errX)).Error("Failed to get the
cluster nodes info from node")
+ // set empty explicitly
+ latestClusterNodesStr =
""
+ } else {
+ latestClusterNodesStr =
clusterNodesStr
+ }
+ }
+ mu.Unlock()
}
c.resetFailureCount(n.ID())
}(i, node)
}
}
+
+ wg.Wait()
+ if latestNodeVersion > cluster.Version.Load() && latestClusterNodesStr
!= "" {
Review Comment:
@greatsharp latestNodeVersion is always 0 because there's no place to update
it.
--
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]