Hi:
i faced a problem about cluster as described following.
redis-version: 3.2.12 && 4.0.14.
1. first,i have a cluster A ,it consists of p1、p2 、p3、p4、p5、p6,p4 replicate p1 ,p5 replicate p2,p6 replicate p3.
2. after some time,p1、p5、p6 fails,these fail nodes are not deleted from Cluster A;in addition,we join p7 、p8、p9 nodes to cluster A,p7 replicate p4 ,p8 replicate p2,p9 replicate p3.
3. from p2、p3、p4 cluster nodes view, p1、p5、p6 state/flag was fail;from p7、p8、p9 cluster nodes view,p1、p5、p6 state/flag was handshake.
4. now we need to create a new cluster B,cluster B select p1、p5、p6 ( nodes.conf 、dump.rdb etc about cluster A were deleted) and p10 、p11、p12 consist cluster B.
5. Unfortunately,we find cluster A and Cluster B are merged。
i read the source code,i think in clusterProcessGossipSection (https://github.com/antirez/redis/blob/23a85ba191ed4d42cc88b76972dc3cb409e765dc/src/cluster.c#L1472), when by nodename find node ==NULL, server try to handshake with node should consider node flag, if node flag/state is fail ,we don't start to handshake。
thanks for reply!
Comment From: liuzhen
It is believed to be a breach of promise by the redis cluster spec which claims that:
trust the nodes introduced by already trusted nodes
does not merge clusters.
Turn out newly joined node would unconditionally bring "imposters" in.