mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Fixed two bugs in the CLUSTER SETSLOT ... NODE subcommand
This commit is contained in:
parent
9a38df8799
commit
d38d2fdfdc
@ -1276,7 +1276,7 @@ void clusterCommand(redisClient *c) {
|
||||
/* CLUSTER SETSLOT <SLOT> STABLE */
|
||||
server.cluster.importing_slots_from[slot] = NULL;
|
||||
server.cluster.migrating_slots_to[slot] = NULL;
|
||||
} else if (!strcasecmp(c->argv[3]->ptr,"node") && c->argc == 4) {
|
||||
} else if (!strcasecmp(c->argv[3]->ptr,"node") && c->argc == 5) {
|
||||
/* CLUSTER SETSLOT <SLOT> NODE <NODE ID> */
|
||||
clusterNode *n = clusterLookupNode(c->argv[4]->ptr);
|
||||
|
||||
@ -1293,7 +1293,7 @@ void clusterCommand(redisClient *c) {
|
||||
keys = zmalloc(sizeof(robj*)*1);
|
||||
numkeys = GetKeysInSlot(slot, keys, 1);
|
||||
zfree(keys);
|
||||
if (numkeys == 0) {
|
||||
if (numkeys != 0) {
|
||||
addReplyErrorFormat(c, "Can't assign hashslot %d to a different node while I still hold keys for this hash slot.", slot);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user