summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-06-16 19:24:34 +0200
committerantirez <antirez@gmail.com>2016-06-16 19:27:24 +0200
commitf7351f4c07f5e0b1c9bdb6949f45f84576ffd75f (patch)
treee48ae879d2a61d165982dd7ce9dc6c1a426f059f
parent7c8f275a24db26a6b9eb5a14439d1156c244dd67 (diff)
downloadredis-f7351f4c07f5e0b1c9bdb6949f45f84576ffd75f.tar.gz
Fix Sentinel pending commands counting.
This bug most experienced effect was an inability of Redis to reconfigure back old masters to slaves after they are reachable again after a failover. This was due to failing to reset the count of the pending commands properly, so the master appeared fovever down. Was introduced in Redis 3.2 new Sentinel connection sharing feature which is a lot more complex than the 3.0 code, but more scalable. Many thanks to people reporting the issue, and especially to @sskorgal for investigating the issue in depth. Hopefully closes #3285.
-rw-r--r--src/sentinel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index 6c48f3ed9..f8ebd0c6f 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -1910,6 +1910,7 @@ void sentinelReconnectInstance(sentinelRedisInstance *ri) {
link->cc->errstr);
instanceLinkCloseConnection(link,link->cc);
} else {
+ link->pending_commands = 0;
link->cc_conn_time = mstime();
link->cc->data = link;
redisAeAttach(server.el,link->cc);