提交 2e167f7d 编写于 作者: W WuYunlong

fix server.repl_down_since resetting, so that slaves could failover

automatically as expected.
上级 aeb7bc3e
......@@ -1087,6 +1087,7 @@ void replicationCreateMasterClient(int fd, int dbid) {
if (server.master->reploff == -1)
server.master->flags |= CLIENT_PRE_PSYNC;
if (dbid != -1) selectDb(server.master,dbid);
server.repl_down_since = 0;
}
void restartAOF() {
......@@ -1950,7 +1951,6 @@ void replicationSetMaster(char *ip, int port) {
* our own parameters, to later PSYNC with the new master. */
if (was_master) replicationCacheMasterUsingMyself();
server.repl_state = REPL_STATE_CONNECT;
server.repl_down_since = 0;
}
/* Cancel replication, setting the instance as a master itself. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册