Added additional validation for cluster SETSLOT (#9360)
This commit is contained in:
parent
2402f5a7a1
commit
0cf2df84d4
@ -4652,6 +4652,10 @@ NULL
|
||||
(char*)c->argv[4]->ptr);
|
||||
return;
|
||||
}
|
||||
if (nodeIsSlave(n)) {
|
||||
addReplyError(c,"Target node is not a master");
|
||||
return;
|
||||
}
|
||||
server.cluster->migrating_slots_to[slot] = n;
|
||||
} else if (!strcasecmp(c->argv[3]->ptr,"importing") && c->argc == 5) {
|
||||
if (server.cluster->slots[slot] == myself) {
|
||||
@ -4664,6 +4668,10 @@ NULL
|
||||
(char*)c->argv[4]->ptr);
|
||||
return;
|
||||
}
|
||||
if (nodeIsSlave(n)) {
|
||||
addReplyError(c,"Target node is not a master");
|
||||
return;
|
||||
}
|
||||
server.cluster->importing_slots_from[slot] = n;
|
||||
} else if (!strcasecmp(c->argv[3]->ptr,"stable") && c->argc == 4) {
|
||||
/* CLUSTER SETSLOT <SLOT> STABLE */
|
||||
|
Loading…
x
Reference in New Issue
Block a user