Replica always reports master's config epoch in CLUSTER NODES output. (#7235)

This commit is contained in:
Qu Chen 2020-07-13 07:16:06 -07:00 committed by GitHub
parent 6a81450144
commit 938c35302f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4104,11 +4104,15 @@ sds clusterGenNodeDescription(clusterNode *node) {
else
ci = sdscatlen(ci," - ",3);
unsigned long long nodeEpoch = node->configEpoch;
if (nodeIsSlave(node) && node->slaveof) {
nodeEpoch = node->slaveof->configEpoch;
}
/* Latency from the POV of this node, config epoch, link status */
ci = sdscatprintf(ci,"%lld %lld %llu %s",
(long long) node->ping_sent,
(long long) node->pong_received,
(unsigned long long) node->configEpoch,
nodeEpoch,
(node->link || node->flags & CLUSTER_NODE_MYSELF) ?
"connected" : "disconnected");