From 1902a9c5320f4dfdb3151324c2e64548addbcb4d Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 13 Mar 2013 12:51:10 +0100 Subject: [PATCH] Replication: master_link_down_since_seconds initial value should be huge. server.repl_down_since used to be initialized to the current time at startup. This is wrong since the replication never started. Clients testing this filed to check if data is uptodate should never believe data is recent if we never ever connected to our master. --- src/redis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redis.c b/src/redis.c index faf05e17b..5928d9db1 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1275,7 +1275,7 @@ void initServerConfig() { server.repl_syncio_timeout = REDIS_REPL_SYNCIO_TIMEOUT; server.repl_serve_stale_data = 1; server.repl_slave_ro = 1; - server.repl_down_since = time(NULL); + server.repl_down_since = 0; /* Never connected, repl is down since EVER. */ server.repl_disable_tcp_nodelay = 0; server.slave_priority = REDIS_DEFAULT_SLAVE_PRIORITY; server.master_repl_offset = 0;