DartTableInputSpecSlicer: Fix for TLS workers. (#17224)

We should use getHost(), which returns TLS if configured or plaintext
otherwise. getHostAndPort() returns plaintext only.
This commit is contained in:
Gian Merlino 2024-10-02 20:01:11 -07:00 committed by GitHub
parent 715ae5ece0
commit fbc1221837
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -168,7 +168,7 @@ public class DartTableInputSpecSlicer implements InputSpecSlicer
return UNKNOWN;
}
final String serverHostAndPort = server.getServer().getHostAndPort();
final String serverHostAndPort = server.getServer().getHost();
final int workerNumber = workerIdToNumber.getInt(serverHostAndPort);
// The worker number may be UNKNOWN in a race condition, such as the set of Historicals changing while

View File

@ -76,8 +76,8 @@ public class DartTableInputSpecSlicerTest extends InitializedNullHandlingTest
* This makes tests deterministic.
*/
private static final List<DruidServerMetadata> SERVERS = ImmutableList.of(
new DruidServerMetadata("no", "localhost:1001", null, 1, ServerType.HISTORICAL, "__default", 2),
new DruidServerMetadata("no", "localhost:1002", null, 1, ServerType.HISTORICAL, "__default", 1),
new DruidServerMetadata("no", "localhost:1001", null, 1, ServerType.HISTORICAL, "__default", 2), // plaintext
new DruidServerMetadata("no", null, "localhost:1002", 1, ServerType.HISTORICAL, "__default", 1), // TLS
new DruidServerMetadata("no", "localhost:1003", null, 1, ServerType.REALTIME, "__default", 0)
);
@ -86,7 +86,7 @@ public class DartTableInputSpecSlicerTest extends InitializedNullHandlingTest
*/
private static final List<String> WORKER_IDS =
SERVERS.stream()
.map(server -> new WorkerId("http", server.getHostAndPort(), QUERY_ID).toString())
.map(server -> new WorkerId("http", server.getHost(), QUERY_ID).toString())
.collect(Collectors.toList());
/**