提交 a687cbc1 编写于 作者: A antirez

Cluster: periodically call clusterUpdateState() when cluster is down.

Usually we update the cluster state (to understand if we should accept
queries or reply with an error) only when there is a change in the state
of the nodes. However for the "delayed rejoin" feature to work, that is,
for a master to wait some time before accepting queries again after it
rejoins the majority, we need to periodically update the last time when
the node was partitioned away from the majority.

With this commit if the cluster is down we update the state ten times
per second.
上级 25ddefde
......@@ -2207,7 +2207,8 @@ void clusterCron(void) {
}
clusterHandleSlaveFailover();
if (update_state) clusterUpdateState();
if (update_state || server.cluster->state == REDIS_CLUSTER_FAIL)
clusterUpdateState();
}
/* This function is called before the event handler returns to sleep for
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册