From c2595500ac6f9075b8a4f872e3c83ae1b0aee9c3 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 14 Mar 2013 16:39:02 +0100 Subject: [PATCH] Cluster: request failover authorization, log if we have quorum. However the failover is yet not really performed. --- src/cluster.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 9cdcb373..67e90773 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1325,7 +1325,7 @@ void clusterSendFailoverAuthIfNeeded(clusterNode *node) { } /* This function is called if we are a slave node and our master serving - * a non-zero amount of hash slots is in PFAIL state. + * a non-zero amount of hash slots is in FAIL state. * * The gaol of this function is: * 1) To check if we are able to perform a failover, is our data updated? @@ -1352,12 +1352,14 @@ void clusterHandleSlaveFailover(void) { server.cluster->failover_auth_time = time(NULL); server.cluster->failover_auth_count = 0; - /* TODO: Broadcast the AUTH request. */ + clusterRequestFailoverAuth(); return; /* Wait for replies. */ } /* Check if we reached the quorum. */ if (server.cluster->failover_auth_count > needed_quorum) { + redisLog(REDIS_WARNING, + "Masters quorum reached: failing over my (failing) master."); /* TODO: Perform election. */ /* TODO: Broadcast update to cluster. */ }