From 6ce536db498031c12acbb4f79a80ca99275a5e1a Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 11 Jan 2016 15:00:45 +0100 Subject: [PATCH] Cluster: don't allow CLUSTER SETSLOT with slaves. --- src/cluster.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index abd267d6..ffeff4f3 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -3945,6 +3945,11 @@ void clusterCommand(client *c) { int slot; clusterNode *n; + if (nodeIsSlave(myself)) { + addReplyError(c,"Please use SETSLOT only with masters."); + return; + } + if ((slot = getSlotOrReply(c,c->argv[2])) == -1) return; if (!strcasecmp(c->argv[3]->ptr,"migrating") && c->argc == 5) {