From 1caae15fddd223e1f0868390474d2379477da9a4 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 17 Jan 2014 18:20:31 +0100 Subject: [PATCH] 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. --- src/replication.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/replication.c b/src/replication.c index f00cb0334..553c81b9a 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1261,6 +1261,7 @@ void replicationSetMaster(char *ip, int port) { cancelReplicationHandshake(); server.repl_state = REDIS_REPL_CONNECT; server.master_repl_offset = 0; + server.repl_down_since = 0; } /* Cancel replication, setting the instance as a master itself. */