skip slave nodes when sending cluster setslot command

This commit is contained in:
yongman 2018-11-21 23:01:35 +08:00
parent 8acc07e6f0
commit 2f76829dc7

View File

@ -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);