mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Set server.repl_down_since to 0 when changing master.
When an instance is potentially set to replicate with another master, it is conceptually disconnected forever, since we have no old copy of the dataset for this master in memory.
This commit is contained in:
parent
36c24bcca0
commit
abd6308d27
@ -1261,6 +1261,7 @@ void replicationSetMaster(char *ip, int port) {
|
|||||||
cancelReplicationHandshake();
|
cancelReplicationHandshake();
|
||||||
server.repl_state = REDIS_REPL_CONNECT;
|
server.repl_state = REDIS_REPL_CONNECT;
|
||||||
server.master_repl_offset = 0;
|
server.master_repl_offset = 0;
|
||||||
|
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