From 42fa46e49a9b71d38f4410b3376f3f2bec8d716d Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 26 Sep 2013 13:28:19 +0200 Subject: [PATCH] Cluster: removed an old source of delay to start the slave failover. --- src/cluster.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 24d3efe3..d8508606 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1624,7 +1624,7 @@ void clusterHandleSlaveFailover(void) { if (mstime() < server.cluster->failover_auth_time) return; /* Return ASAP if the election is too old to be valid. */ - if (mstime() - server.cluster->failover_auth_time > server.cluster_node_timeout) + if (mstime() - server.cluster->failover_auth_time > server.cluster_node_timeout * 1000) return; /* Ask for votes if needed. */ @@ -1835,16 +1835,10 @@ void clusterCron(void) { } /* If we are a slave and our master is down, but is serving slots, - * call the function that handles the failover. - * This function is called with a small delay in order to let the - * FAIL message to propagate after failure detection, this is not - * strictly required but makes 99.99% of failovers mechanically - * simpler. */ + * call the function that handles the failover. */ if (server.cluster->myself->flags & REDIS_NODE_SLAVE && server.cluster->myself->slaveof && server.cluster->myself->slaveof->flags & REDIS_NODE_FAIL && - (server.unixtime - server.cluster->myself->slaveof->fail_time) > - REDIS_CLUSTER_FAILOVER_DELAY && server.cluster->myself->slaveof->numslots != 0) { clusterHandleSlaveFailover(); -- GitLab