mirror of
https://github.com/fluencelabs/redis
synced 2025-03-25 20:01:04 +00:00
Cluster: new command CLUSTER FLUSHSLOTS.
It's just a simpler way to CLUSTER DELSLOTS with all the slots as arguments, in order to obtain a node without assigned slots for reconfiguration.
This commit is contained in:
parent
7d3e32d526
commit
88221f88c0
@ -1961,6 +1961,16 @@ void clusterCommand(redisClient *c) {
|
|||||||
o = createObject(REDIS_STRING,ci);
|
o = createObject(REDIS_STRING,ci);
|
||||||
addReplyBulk(c,o);
|
addReplyBulk(c,o);
|
||||||
decrRefCount(o);
|
decrRefCount(o);
|
||||||
|
} else if (!strcasecmp(c->argv[1]->ptr,"flushslots") && c->argc == 2) {
|
||||||
|
/* CLUSTER FLUSHSLOTS */
|
||||||
|
if (dictSize(server.db[0].dict) != 0) {
|
||||||
|
addReplyError(c,"DB must be empty to perform CLUSTER FLUSHSLOTS.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clusterDelNodeSlots(server.cluster->myself);
|
||||||
|
clusterUpdateState();
|
||||||
|
clusterSaveConfigOrDie();
|
||||||
|
addReply(c,shared.ok);
|
||||||
} else if ((!strcasecmp(c->argv[1]->ptr,"addslots") ||
|
} else if ((!strcasecmp(c->argv[1]->ptr,"addslots") ||
|
||||||
!strcasecmp(c->argv[1]->ptr,"delslots")) && c->argc >= 3)
|
!strcasecmp(c->argv[1]->ptr,"delslots")) && c->argc >= 3)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user