From a6fe4ca3214a8ff5b17d73bcd3c293454b6ad15c Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 25 Jun 2014 15:08:33 +0200 Subject: [PATCH] CLUSTER SLOTS: main loop should skip only slaves and zero slot masters. --- src/cluster.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 252f19f0..264ef4f6 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -3467,9 +3467,9 @@ void clusterReplyMultiBulkSlots(redisClient *c) { clusterNode *node = dictGetVal(de); int j = 0, start = -1; - /* If node is down or not a master, skip it. */ - if (node->flags & REDIS_NODE_FAIL || !(node->flags & REDIS_NODE_MASTER)) - continue; + /* Skip slaves (that are iterated when producing the output of their + * master) and masters not serving any slot. */ + if (!nodeIsMaster(node) || node->numslots == 0) continue; for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) { int bit;