提交 66ec1412 编写于 作者: A antirez

Redis Cluster: add repl_ping_slave_period to slave data validity time.

When the configured node timeout is very small, the data validity time
(maximum data age for a slave to try a failover) is too little (ten
times the configured node timeout) when the replication link with the
master is mostly idle. In this case we'll receive some data from the
master only every server.repl_ping_slave_period to refresh the last
interaction with the master.

This commit adds to the max data validity time the slave ping period to
avoid this problem of slaves sensing too old data without a good reason.
However this max data validity time is likely a setting that should be
configurable by the Redis Cluster user in a way completely independent
from the node timeout.
上级 b2dedd9d
......@@ -1900,7 +1900,8 @@ void clusterHandleSlaveFailover(void) {
* constant of ten times the node timeout since the cluster should
* react much faster to a master down. */
if (data_age >
server.cluster_node_timeout * REDIS_CLUSTER_SLAVE_VALIDITY_MULT)
(server.repl_ping_slave_period * 1000) +
(server.cluster_node_timeout * REDIS_CLUSTER_SLAVE_VALIDITY_MULT))
return;
/* Compute the time at which we can start an election. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册