walterddr commented on code in PR #12276:
URL: https://github.com/apache/pinot/pull/12276#discussion_r1458036877


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BalancedInstanceSelector.java:
##########
@@ -89,7 +91,13 @@ Pair<Map<String, String>, Map<String, String>> 
select(List<String> segments, int
         if (candidates == null) {
           continue;
         }
-        int selectedIdx = requestId++ % candidates.size();
+        int selectedIdx;
+        if (_useStickyRouting || 
QueryOptionsUtils.isUseStickyRouting(queryOptions)) {
+          // candidates array is always sorted
+          selectedIdx = Math.abs(_tableNameWithType.hashCode() % 
candidates.size());

Review Comment:
   yes I meant server and the concern is with traffic skew b/c all sticky 
routing query are going to hit the same replica of the table (request is based 
on tableName hash)
   
   if we dont have a clientID for sticky routing i dont think there's any other 
way to achieve this. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to