diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeScheduler.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeScheduler.java index 0536db2c1e43..fef4831353c4 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeScheduler.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeScheduler.java @@ -107,17 +107,17 @@ public static List selectExactNodes(NodeMap nodeMap, List includeCoordinator || !coordinatorIds.contains(node.getNodeIdentifier())) .forEach(chosen::add); - InetAddress address; - try { - address = host.toInetAddress(); - } - catch (UnknownHostException e) { - // skip hosts that don't resolve - continue; - } - // consider a split with a host without a port as being accessible by all nodes in that host if (!host.hasPort()) { + InetAddress address; + try { + address = host.toInetAddress(); + } + catch (UnknownHostException e) { + // skip hosts that don't resolve + continue; + } + nodeMap.getNodesByHost().get(address).stream() .filter(node -> includeCoordinator || !coordinatorIds.contains(node.getNodeIdentifier())) .forEach(chosen::add); @@ -133,17 +133,17 @@ public static List selectExactNodes(NodeMap nodeMap, List