You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ro...@apache.org on 2022/06/08 06:03:06 UTC

[pinot] 07/11: [hotfix] fix server discovery (#8664)

This is an automated email from the ASF dual-hosted git repository.

rongr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git

commit 57cf9e6f5199d5fa5633775853d36754701fa5e5
Author: Rong Rong <ro...@apache.org>
AuthorDate: Mon May 9 20:20:03 2022 -0700

    [hotfix] fix server discovery (#8664)
    
    Co-authored-by: Rong Rong <ro...@startree.ai>
---
 .../main/java/org/apache/pinot/query/routing/WorkerInstance.java  | 2 +-
 .../test/java/org/apache/pinot/query/QueryEnvironmentTest.java    | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerInstance.java b/pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerInstance.java
index 7ad6ee0b9c..c7e6bcfbd5 100644
--- a/pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerInstance.java
+++ b/pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerInstance.java
@@ -41,7 +41,7 @@ public class WorkerInstance extends ServerInstance {
   }
 
   private static InstanceConfig toInstanceConfig(String hostname, int serverPort, int mailboxPort) {
-    String server = String.format("%s_%d", hostname, serverPort);
+    String server = String.format("%s%s_%d", CommonConstants.Helix.PREFIX_OF_SERVER_INSTANCE, hostname, serverPort);
     InstanceConfig instanceConfig = InstanceConfig.toInstanceConfig(server);
     ZNRecord znRecord = instanceConfig.getRecord();
     Map<String, String> simpleFields = znRecord.getSimpleFields();
diff --git a/pinot-query-planner/src/test/java/org/apache/pinot/query/QueryEnvironmentTest.java b/pinot-query-planner/src/test/java/org/apache/pinot/query/QueryEnvironmentTest.java
index d63c5c55c7..9f4778743b 100644
--- a/pinot-query-planner/src/test/java/org/apache/pinot/query/QueryEnvironmentTest.java
+++ b/pinot-query-planner/src/test/java/org/apache/pinot/query/QueryEnvironmentTest.java
@@ -68,18 +68,18 @@ public class QueryEnvironmentTest extends QueryEnvironmentTestBase {
         // table scan stages; for tableA it should have 2 hosts, for tableB it should have only 1
         Assert.assertEquals(
             e.getValue().getServerInstances().stream().map(ServerInstance::toString).collect(Collectors.toList()),
-            tables.get(0).equals("a") ? ImmutableList.of("localhost_1", "localhost_2")
-                : ImmutableList.of("localhost_1"));
+            tables.get(0).equals("a") ? ImmutableList.of("Server_localhost_1", "Server_localhost_2")
+                : ImmutableList.of("Server_localhost_1"));
       } else if (!PlannerUtils.isRootStage(e.getKey())) {
         // join stage should have both servers used.
         Assert.assertEquals(
             e.getValue().getServerInstances().stream().map(ServerInstance::toString).collect(Collectors.toList()),
-            ImmutableList.of("localhost_1", "localhost_2"));
+            ImmutableList.of("Server_localhost_1", "Server_localhost_2"));
       } else {
         // reduce stage should have the reducer instance.
         Assert.assertEquals(
             e.getValue().getServerInstances().stream().map(ServerInstance::toString).collect(Collectors.toList()),
-            ImmutableList.of("localhost_3"));
+            ImmutableList.of("Server_localhost_3"));
       }
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org