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


##########
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:
   Ack



-- 
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