Commit 76a3954f authored by antirez's avatar antirez
Browse files

Cluster: fix clusterHandleSlaveFailover() conditional: quorum is enough.

parent 90e99a20
...@@ -1355,16 +1355,16 @@ void clusterHandleSlaveFailover(void) { ...@@ -1355,16 +1355,16 @@ void clusterHandleSlaveFailover(void) {
/* Ask masters if we are authorized to perform the failover. If there /* Ask masters if we are authorized to perform the failover. If there
* is a pending auth request that's too old, reset it. */ * 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_time = time(NULL);
server.cluster->failover_auth_count = 0; server.cluster->failover_auth_count = 0;
clusterRequestFailoverAuth(); clusterRequestFailoverAuth();
return; /* Wait for replies. */ return; /* Wait for replies. */
} }
/* Check if we reached the quorum. */ /* 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, redisLog(REDIS_WARNING,
"Masters quorum reached: failing over my (failing) master."); "Masters quorum reached: failing over my (failing) master.");
/* TODO: Perform election. */ /* TODO: Perform election. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment