提交 6d550f2d 编写于 作者: A antirez

Cluster: configEpoch assignment in SETNODE improved.

Avoid to trash a configEpoch for every slot migrated if this node has
already the max configEpoch across the cluster.

Still work to do in this area but this avoids both ending with a very
high configEpoch without any reason and to flood the system with fsyncs.
上级 585e9fb8
...@@ -3174,9 +3174,13 @@ void clusterCommand(redisClient *c) { ...@@ -3174,9 +3174,13 @@ void clusterCommand(redisClient *c) {
* FIXME: the new version should be agreed otherwise a race * FIXME: the new version should be agreed otherwise a race
* is possible if while a manual resharding is in progress * is possible if while a manual resharding is in progress
* the master is failed over by a slave. */ * the master is failed over by a slave. */
server.cluster->currentEpoch++; uint64_t maxEpoch = clusterGetMaxEpoch();
myself->configEpoch = server.cluster->currentEpoch;
clusterDoBeforeSleep(CLUSTER_TODO_FSYNC_CONFIG); if (myself->configEpoch != maxEpoch) {
server.cluster->currentEpoch++;
myself->configEpoch = server.cluster->currentEpoch;
clusterDoBeforeSleep(CLUSTER_TODO_FSYNC_CONFIG);
}
server.cluster->importing_slots_from[slot] = NULL; server.cluster->importing_slots_from[slot] = NULL;
} }
clusterDelSlot(slot); clusterDelSlot(slot);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册