提交 8b059f06 编写于 作者: A antirez

Cluster: check that configEpoch never goes back.

Since there are ways to alter the configEpoch outside of the failover
procedure (for exampel CLUSTER SET-CONFIG-EPOCH and via the configEpoch
collision resolution algorithm), make always sure, before replacing our
configEpoch with a new one, that it is greater than the current one.
上级 67029323
......@@ -2516,7 +2516,8 @@ void clusterHandleSlaveFailover(void) {
}
/* 3) Update my configEpoch to the epoch of the election. */
myself->configEpoch = server.cluster->failover_auth_epoch;
if (myself->configEpoch < server.cluster->failover_auth_epoch)
myself->configEpoch = server.cluster->failover_auth_epoch;
/* 4) Update state and save config. */
clusterUpdateState();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册