NIFI-2289: Ensure that we include Node ID's of all nodes when finding cluster coordinator, even if the node is currently still connecting or has not yet joined the cluster, which ccan be the case if all nodes in the cluster are restarting at the same time.

This closes #681

Signed-off-by: jpercivall <joepercivall@yahoo.com>
This commit is contained in:
Mark Payne 2016-07-19 15:57:05 -04:00 committed by jpercivall
parent 39a4d84a62
commit 7f2bda29d9
1 changed files with 1 additions and 1 deletions

View File

@ -532,7 +532,7 @@ public class NodeClusterCoordinator implements ClusterCoordinator, ProtocolHandl
return null;
}
final Set<NodeIdentifier> connectedNodeIds = getNodeIdentifiers(NodeConnectionState.CONNECTED);
final Set<NodeIdentifier> connectedNodeIds = getNodeIdentifiers();
final NodeIdentifier electedNodeId = connectedNodeIds.stream()
.filter(nodeId -> nodeId.getSocketAddress().equals(electedNodeHostname) && nodeId.getSocketPort() == electedNodePort)
.findFirst()