From e26f4486b07070d795644a16e50429917b86eee0 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 11 Mar 2014 11:53:09 +0100 Subject: [PATCH] Cluster: update node configEpoch on UPDATE messages. The UPDATE message contains the configEpoch of the node configuration advertised in the packet. Update it if needed. --- src/cluster.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index c9b39094d..d2490dbae 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1546,6 +1546,10 @@ int clusterProcessPacket(clusterLink *link) { /* If in our current config the node is a slave, set it as a master. */ if (nodeIsSlave(n)) clusterSetNodeAsMaster(n); + /* Update the node's configEpoch. */ + n->configEpoch = reportedConfigEpoch; + clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|CLUSTER_TODO_FSYNC_CONFIG); + /* Check the bitmap of served slots and udpate our * config accordingly. */ clusterUpdateSlotsConfigWith(n,reportedConfigEpoch, -- GitLab