From 524be1e4656f53c347367fb5c7b1ac7e80b890e9 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 c0a79d9fb..2fe7db1b7 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -3940,6 +3940,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) {