提交 a81340ab 编写于 作者: A antirez

Cluster: set a minimum rejoin delay if node_timeout is too small.

The rejoin delay usually is the node timeout. However if the node
timeout is too small, we set it to 500 milliseconds, that is a value
chosen to be greater than most setups RTT / instances latency figures
so that likely communication with other nodes happen before rejoining.
上级 a687cbc1
......@@ -2327,6 +2327,7 @@ int clusterDelNodeSlots(clusterNode *node) {
* -------------------------------------------------------------------------- */
#define REDIS_CLUSTER_MAX_REJOIN_DELAY 5000
#define REDIS_CLUSTER_MIN_REJOIN_DELAY 500
void clusterUpdateState(void) {
int j, new_state;
......@@ -2392,6 +2393,8 @@ void clusterUpdateState(void) {
* a configuration update. */
if (rejoin_delay > REDIS_CLUSTER_MAX_REJOIN_DELAY)
rejoin_delay = REDIS_CLUSTER_MAX_REJOIN_DELAY;
if (rejoin_delay < REDIS_CLUSTER_MIN_REJOIN_DELAY)
rejoin_delay = REDIS_CLUSTER_MIN_REJOIN_DELAY;
if (new_state == REDIS_CLUSTER_OK &&
server.cluster->myself->flags & REDIS_NODE_MASTER &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册