Discovery: Don't include local node to pingMasters list. We might end up electing ourselves without any form of verification.
This commit is contained in:
parent
5e38e9eb4f
commit
c2142c0f6d
|
@ -864,7 +864,11 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
|||
List<DiscoveryNode> pingMasters = newArrayList();
|
||||
for (ZenPing.PingResponse pingResponse : pingResponses) {
|
||||
if (pingResponse.master() != null) {
|
||||
pingMasters.add(pingResponse.master());
|
||||
// We can't include the local node in pingMasters list, otherwise we may up electing ourselves without
|
||||
// any check / verifications from other nodes in ZenDiscover#innerJoinCluster()
|
||||
if (!localNode.equals(pingResponse.master())) {
|
||||
pingMasters.add(pingResponse.master());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue