Cluster: don't allow CLUSTER SETSLOT with slaves.

This commit is contained in:
antirez 2016-01-11 15:00:45 +01:00
parent 9361687f30
commit 0c2ee17244

View File

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