提交 8b5196ad 编写于 作者: A antirez

Cluster: always increment the configEpoch in SETNODE after import.

Removed a stale conditional preventing the configEpoch from incrementing
after the import in certain conditions. Since the master got a new slot
it should always claim a new configuration.
上级 2e3f6b0f
......@@ -3166,8 +3166,6 @@ void clusterCommand(redisClient *c) {
if (n == myself &&
server.cluster->importing_slots_from[slot])
{
clusterNode *old_owner =
server.cluster->importing_slots_from[slot];
/* This slot was manually migrated, set this node configEpoch
* to a new epoch so that the new version can be propagated
* by the cluster.
......@@ -3175,11 +3173,9 @@ void clusterCommand(redisClient *c) {
* FIXME: the new version should be agreed otherwise a race
* is possible if while a manual resharding is in progress
* the master is failed over by a slave. */
if (old_owner->configEpoch > myself->configEpoch) {
server.cluster->currentEpoch++;
myself->configEpoch = server.cluster->currentEpoch;
clusterDoBeforeSleep(CLUSTER_TODO_FSYNC_CONFIG);
}
server.cluster->currentEpoch++;
myself->configEpoch = server.cluster->currentEpoch;
clusterDoBeforeSleep(CLUSTER_TODO_FSYNC_CONFIG);
server.cluster->importing_slots_from[slot] = NULL;
}
clusterDelSlot(slot);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册