mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 09:17:20 +00:00
fix server.repl_down_since resetting, so that slaves could failover
automatically as expected.
This commit is contained in:
parent
9535c21515
commit
8c6223f91d
@ -1087,6 +1087,7 @@ void replicationCreateMasterClient(int fd, int dbid) {
|
|||||||
if (server.master->reploff == -1)
|
if (server.master->reploff == -1)
|
||||||
server.master->flags |= CLIENT_PRE_PSYNC;
|
server.master->flags |= CLIENT_PRE_PSYNC;
|
||||||
if (dbid != -1) selectDb(server.master,dbid);
|
if (dbid != -1) selectDb(server.master,dbid);
|
||||||
|
server.repl_down_since = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void restartAOF() {
|
void restartAOF() {
|
||||||
@ -1942,7 +1943,6 @@ void replicationSetMaster(char *ip, int port) {
|
|||||||
* our own parameters, to later PSYNC with the new master. */
|
* our own parameters, to later PSYNC with the new master. */
|
||||||
if (was_master) replicationCacheMasterUsingMyself();
|
if (was_master) replicationCacheMasterUsingMyself();
|
||||||
server.repl_state = REPL_STATE_CONNECT;
|
server.repl_state = REPL_STATE_CONNECT;
|
||||||
server.repl_down_since = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cancel replication, setting the instance as a master itself. */
|
/* Cancel replication, setting the instance as a master itself. */
|
||||||
|
Loading…
Reference in New Issue
Block a user