mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
Fixed semantics of CLUSTER SETSLOT, SELECT now only denied in cluster mode if selected DB is not 0 so that MIGRATE still works well.
This commit is contained in:
parent
46834808fe
commit
a7b058dae6
@ -1219,11 +1219,11 @@ void clusterCommand(redisClient *c) {
|
||||
return;
|
||||
}
|
||||
slot = (unsigned int) aux;
|
||||
if (server.cluster.slots[slot] != server.cluster.myself) {
|
||||
addReplyErrorFormat(c,"I'm not the owner of hash slot %u",slot);
|
||||
return;
|
||||
}
|
||||
if (!strcasecmp(c->argv[3]->ptr,"migrating") && c->argc == 5) {
|
||||
if (server.cluster.slots[slot] != server.cluster.myself) {
|
||||
addReplyErrorFormat(c,"I'm not the owner of hash slot %u",slot);
|
||||
return;
|
||||
}
|
||||
if ((n = clusterLookupNode(c->argv[4]->ptr)) == NULL) {
|
||||
addReplyErrorFormat(c,"I don't know about node %s",
|
||||
(char*)c->argv[4]->ptr);
|
||||
@ -1231,6 +1231,11 @@ void clusterCommand(redisClient *c) {
|
||||
}
|
||||
server.cluster.migrating_slots_to[slot] = n;
|
||||
} else if (!strcasecmp(c->argv[3]->ptr,"importing") && c->argc == 5) {
|
||||
if (server.cluster.slots[slot] == server.cluster.myself) {
|
||||
addReplyErrorFormat(c,
|
||||
"I'm already the owner of hash slot %u",slot);
|
||||
return;
|
||||
}
|
||||
if ((n = clusterLookupNode(c->argv[4]->ptr)) == NULL) {
|
||||
addReplyErrorFormat(c,"I don't know about node %s",
|
||||
(char*)c->argv[3]->ptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user