diff --git a/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java b/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java index 1af388806ed..837085c2812 100644 --- a/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java +++ b/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java @@ -419,7 +419,7 @@ public class TransportClientNodesService extends AbstractComponent { return; } - HashSet newNodes = new HashSet(); + HashSet newNodes = new HashSet(listedNodes); for (ClusterStateResponse clusterStateResponse : clusterStateResponses) { if (!ignoreClusterName && !clusterName.equals(clusterStateResponse.getClusterName())) { logger.warn("node {} not part of the cluster {}, ignoring...", clusterStateResponse.getState().nodes().localNode(), clusterName);