diff --git a/src/cluster.c b/src/cluster.c index dc4540c2..a2d79164 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -481,7 +481,8 @@ void clusterInit(void) { * 3) If the node is a slave, it turns into a master. * 5) Only for hard reset: a new Node ID is generated. * 6) Only for hard reset: currentEpoch and configEpoch are set to 0. - * 7) The new configuration is saved and the cluster state updated. */ + * 7) The new configuration is saved and the cluster state updated. + * 8) If the node was a slave, the whole data set is flushed away. */ void clusterReset(int hard) { dictIterator *di; dictEntry *de; @@ -491,6 +492,7 @@ void clusterReset(int hard) { if (nodeIsSlave(myself)) { clusterSetNodeAsMaster(myself); replicationUnsetMaster(); + emptyDb(NULL); } /* Close slots, reset manual failover state. */