提交 62b15914 编写于 作者: A antirez

Cluster: re-order failover operations to make it safer.

We need to:

1) Increment the configEpoch.
2) Save it to disk and fsync the file.
3) Broadcast the PONG with the new configuration.

If other nodes will receive the updated configuration we need to be sure
to restart with this new config in the event of a crash.
上级 b1875177
......@@ -1693,16 +1693,16 @@ void clusterHandleSlaveFailover(void) {
}
}
/* 3) Pong all the other nodes so that they can update the state
* accordingly and detect that we switched to master role. */
clusterBroadcastPong();
/* 4) Update my configEpoch to the epoch of the election. */
/* 3) Update my configEpoch to the epoch of the election. */
server.cluster->myself->configEpoch = server.cluster->failover_auth_epoch;
/* 5) Update state and save config. */
/* 4) Update state and save config. */
clusterUpdateState();
clusterSaveConfigOrDie();
/* 5) Pong all the other nodes so that they can update the state
* accordingly and detect that we switched to master role. */
clusterBroadcastPong();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册