提交 3cf6f1f5 编写于 作者: A antirez

Cluster: clusterHandleConfigEpochCollision() fixed.

New config epochs must always be obtained incrementing the currentEpoch,
that is itself guaranteed to be >= the max configEpoch currently known
to the node.
上级 80d4c52c
......@@ -1235,11 +1235,12 @@ void clusterHandleConfigEpochCollision(clusterNode *sender) {
/* Don't act if the colliding node has a smaller Node ID. */
if (memcmp(sender->name,myself->name,REDIS_CLUSTER_NAMELEN) <= 0) return;
/* Get the next ID available at the best of this node knowledge. */
myself->configEpoch = clusterGetMaxEpoch()+1;
server.cluster->currentEpoch++;
myself->configEpoch = server.cluster->currentEpoch;
clusterSaveConfigOrDie(1);
redisLog(REDIS_VERBOSE,
"WARNING: configEpoch collision with node %.40s."
"Updating my configEpoch to %llu",
" Updating my configEpoch to %llu",
sender->name,
(unsigned long long) myself->configEpoch);
}
......@@ -3343,6 +3344,9 @@ void clusterCommand(redisClient *c) {
server.cluster->currentEpoch++;
myself->configEpoch = server.cluster->currentEpoch;
clusterDoBeforeSleep(CLUSTER_TODO_FSYNC_CONFIG);
redisLog(REDIS_WARNING,
"configEpoch set to %llu after importing slot %d",
(unsigned long long) myself->configEpoch, slot);
}
server.cluster->importing_slots_from[slot] = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册