mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Cluster: SET-CONFIG-EPOCH should update currentEpoch.
SET-CONFIG-EPOCH, used by redis-trib at cluster creation time, failed to update the currentEpoch, making it possible after a failover for a server to set its configEpoch to a value smaller than the current one (since configEpochs are obtained using currentEpoch). The bug totally break the Redis Cluster algorithms and protocols allowing for permanent split brain conditions about the slots configuration as shown in issue #1799.
This commit is contained in:
parent
a2403227c7
commit
a2c2ef7de5
@ -3790,6 +3790,8 @@ void clusterCommand(redisClient *c) {
|
||||
addReplyError(c,"Node config epoch is already non-zero");
|
||||
} else {
|
||||
myself->configEpoch = epoch;
|
||||
if (server.cluster->currentEpoch < epoch)
|
||||
server.cluster->currentEpoch = epoch;
|
||||
/* No need to fsync the config here since in the unlucky event
|
||||
* of a failure to persist the config, the conflict resolution code
|
||||
* will assign an unique config to this node. */
|
||||
|
Loading…
Reference in New Issue
Block a user