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,9 +864,13 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
||||||
List<DiscoveryNode> pingMasters = newArrayList();
|
List<DiscoveryNode> pingMasters = newArrayList();
|
||||||
for (ZenPing.PingResponse pingResponse : pingResponses) {
|
for (ZenPing.PingResponse pingResponse : pingResponses) {
|
||||||
if (pingResponse.master() != null) {
|
if (pingResponse.master() != null) {
|
||||||
|
// 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());
|
pingMasters.add(pingResponse.master());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Set<DiscoveryNode> possibleMasterNodes = Sets.newHashSet();
|
Set<DiscoveryNode> possibleMasterNodes = Sets.newHashSet();
|
||||||
if (localNode.masterNode()) {
|
if (localNode.masterNode()) {
|
||||||
|
|
Loading…
Reference in New Issue