Jackie-Jiang commented on code in PR #11241:
URL: https://github.com/apache/pinot/pull/11241#discussion_r1281460234


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java:
##########
@@ -214,31 +215,19 @@ private String getMultiStageQueryResponse(String query, 
String queryOptions, Htt
       // tenants can be completely disjoint. The leaf stages which access 
segments will be processed on the respective
       // server tenants for each table. The intermediate stages can be 
processed in either or all of the server tenants
       // belonging to the tables.
-      brokerTenant = getCommonBrokerTenant(tableConfigList);
-      if (brokerTenant == null) {
+      brokerTenants = getCommonBrokerTenants(tableConfigList);
+      if (brokerTenants.isEmpty()) {
         return 
QueryException.getException(QueryException.BROKER_REQUEST_SEND_ERROR, new 
Exception(
             String.format("Unable to dispatch multistage query with multiple 
tables : %s " + "on different tenant",
                 tableNames))).toString();
       }
     } else {
       // TODO fail these queries going forward. Added this logic to take care 
of tautologies like BETWEEN 0 and -1.
-      List<String> allBrokerList = new 
ArrayList<>(_pinotHelixResourceManager.getAllBrokerTenantNames());
-      brokerTenant = allBrokerList.get(RANDOM.nextInt(allBrokerList.size()));
+      brokerTenants = _pinotHelixResourceManager.getAllBrokerTenantNames();

Review Comment:
   Actually, directly picking a random broker might be even better



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to