From 76a3954f4ad4fe138bc77c36d3f1f78528551dbb Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 15 Mar 2013 13:20:23 +0100 Subject: [PATCH] Cluster: fix clusterHandleSlaveFailover() conditional: quorum is enough. --- src/cluster.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index e61df8d5..eeb748bb 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1355,16 +1355,16 @@ void clusterHandleSlaveFailover(void) { /* Ask masters if we are authorized to perform the failover. If there * is a pending auth request that's too old, reset it. */ - if (server.cluster->failover_auth_time == 0 || auth_age > 15) { + if (server.cluster->failover_auth_time == 0 || auth_age > 15) + { server.cluster->failover_auth_time = time(NULL); server.cluster->failover_auth_count = 0; - clusterRequestFailoverAuth(); return; /* Wait for replies. */ } /* Check if we reached the quorum. */ - if (server.cluster->failover_auth_count > needed_quorum) { + if (server.cluster->failover_auth_count >= needed_quorum) { redisLog(REDIS_WARNING, "Masters quorum reached: failing over my (failing) master."); /* TODO: Perform election. */