mirror of
https://github.com/fluencelabs/redis
synced 2025-06-12 08:41:21 +00:00
CLUSTER BUMPEPOCH initial implementation fixed.
This commit is contained in:
@ -4022,13 +4022,6 @@ 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");
|
||||
@ -4036,6 +4029,13 @@ void clusterCommand(client *c) {
|
||||
}
|
||||
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|CLUSTER_TODO_UPDATE_STATE);
|
||||
addReply(c,shared.ok);
|
||||
} else if (!strcasecmp(c->argv[1]->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 if (!strcasecmp(c->argv[1]->ptr,"info") && c->argc == 2) {
|
||||
/* CLUSTER INFO */
|
||||
char *statestr[] = {"ok","fail","needhelp"};
|
||||
|
Reference in New Issue
Block a user