Commit a687cbc1 authored by antirez's avatar antirez
Browse files

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.
parent 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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment