From 7970ebd80a735f6c73c8be1bda0e77f4bcc47a34 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 1 Oct 2013 17:21:28 +0200 Subject: [PATCH] Cluster: senderCurrentEpoch == node currentEpoch was too strict. We can accept a vote as long as its epoch is >= the epoch at which we started the voting process. There is no need for it to be exactly the same. --- src/cluster.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index e5aa043fa..ab5283933 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1191,11 +1191,11 @@ int clusterProcessPacket(clusterLink *link) { } else if (type == CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK) { if (!sender) return 1; /* We don't know that node. */ /* We consider this vote only if the sender is a master serving - * a non zero number of slots, with the currentEpoch that is equal - * to our currentEpoch. */ + * a non zero number of slots, and its currentEpoch is greater or + * equal to epoch where this node started the election. */ if (sender->flags & REDIS_NODE_MASTER && sender->numslots > 0 && - senderCurrentEpoch == server.cluster->currentEpoch) + senderCurrentEpoch >= server.cluster->failover_auth_epoch) { server.cluster->failover_auth_count++; /* Maybe we reached a quorum here, set a flag to make sure -- GitLab