Commit f7351f4c authored by antirez's avatar antirez
Browse files

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.
parent 7c8f275a
...@@ -1910,6 +1910,7 @@ void sentinelReconnectInstance(sentinelRedisInstance *ri) { ...@@ -1910,6 +1910,7 @@ void sentinelReconnectInstance(sentinelRedisInstance *ri) {
link->cc->errstr); link->cc->errstr);
instanceLinkCloseConnection(link,link->cc); instanceLinkCloseConnection(link,link->cc);
} else { } else {
link->pending_commands = 0;
link->cc_conn_time = mstime(); link->cc_conn_time = mstime();
link->cc->data = link; link->cc->data = link;
redisAeAttach(server.el,link->cc); redisAeAttach(server.el,link->cc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment