提交 689b64c3 编写于 作者: O Oran Agra

PSYNC2 fix - promoted slave should hold on to it's backlog

after a slave is promoted (assuming it has no slaves
and it booted over an hour ago), it will lose it's replication
backlog at the next replication cron, rather than waiting for slaves
to connect to it.
so on a simple master/slave faiover, if the new slave doesn't connect
immediately, it may be too later and PSYNC2 will fail.
上级 1b8eec3e
......@@ -1970,6 +1970,11 @@ void replicationUnsetMaster(void) {
* with PSYNC version 2, there is no need for full resync after a
* master switch. */
server.slaveseldb = -1;
/* We need to remember the time when we became a master and lost all
* attached slaves (if we had any), as after some time we'll free the
* replication backlog. */
server.repl_no_slaves_since = server.unixtime;
}
/* This function is called when the slave lose the connection with the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册