From 8c577113ee3d4e0cb38b721f87ef229b7ec13336 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 10 Feb 2014 17:18:16 +0100 Subject: [PATCH] Cluster: clear the FAIL status for masters without slots. Masters without slots don't participate to the cluster but just do redirections, no need to take them in FAIL state if they are back reachable. --- src/cluster.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 167468dc5..848068af2 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -830,9 +830,10 @@ void clearNodeFailureIfNeeded(clusterNode *node) { /* For slaves we always clear the FAIL flag if we can contact the * node again. */ - if (nodeIsSlave(node)) { + if (nodeIsSlave(node) || node->numslots == 0) { redisLog(REDIS_NOTICE, - "Clear FAIL state for node %.40s: slave is reachable again.", + "Clear FAIL state for node %.40s: %s is reachable again.", + nodeIsSlave(node) ? "slave" : "master without slots", node->name); node->flags &= ~REDIS_NODE_FAIL; clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);