From 2f76829dc7ed1c76a2ac17bd6dc9cf7c3b5d7cb5 Mon Sep 17 00:00:00 2001
From: yongman <yming0221@gmail.com>
Date: Wed, 21 Nov 2018 23:01:35 +0800
Subject: [PATCH] skip slave nodes when sending cluster setslot command

---
 src/redis-cli.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/redis-cli.c b/src/redis-cli.c
index 4f68be20..28c842fd 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -3962,6 +3962,7 @@ static int clusterManagerFixOpenSlot(int slot) {
         while ((ln = listNext(&li)) != NULL) {
             clusterManagerNode *n = ln->value;
             if (n == owner) continue;
+            if (n->flags & CLUSTER_MANAGER_FLAG_SLAVE) continue;
             redisReply *r = CLUSTER_MANAGER_COMMAND(n,
                 "CLUSTER SETSLOT %d %s %s", slot, "NODE", owner->name);
             success = clusterManagerCheckRedisReply(n, r, NULL);