mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Cluster: CLUSTER BUMPEPOCH introduced to help redis-trib fix.
Sometimes during "fixes" we have to setup a new configuration and assign slots to nodes. With BUMPEPOCH we can make sure the new configuration of the node will win if there are conflicting configurations (for example another node is *also* claiming the same slot because the cluster is totally messed up).
This commit is contained in:
parent
524be1e465
commit
b58796f520
@ -4022,6 +4022,13 @@ void clusterCommand(client *c) {
|
||||
}
|
||||
clusterDelSlot(slot);
|
||||
clusterAddSlot(n,slot);
|
||||
} else if (!strcasecmp(c->argv[3]->ptr,"bumpepoch") && c->argc == 2) {
|
||||
/* CLUSTER BUMPEPOCH */
|
||||
int retval = clusterBumpConfigEpochWithoutConsensus();
|
||||
sds reply = sdscatprintf(sdsempty(),"%s %llu\r\n",
|
||||
(retval == C_OK) ? "BUMPED" : "STILL",
|
||||
(unsigned long long) myself->configEpoch);
|
||||
addReplySds(c,reply);
|
||||
} else {
|
||||
addReplyError(c,
|
||||
"Invalid CLUSTER SETSLOT action or number of arguments");
|
||||
|
Loading…
Reference in New Issue
Block a user