yashmayya commented on code in PR #17619:
URL: https://github.com/apache/pinot/pull/17619#discussion_r2761544224


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BaseInstanceSelector.java:
##########
@@ -261,16 +261,27 @@ void updateSegmentMaps(IdealState idealState, 
ExternalView externalView, Set<Str
     Set<Integer> pools = new HashSet<>();
     for (String segment : onlineSegments) {
       Map<String, String> idealStateInstanceStateMap = 
idealStateAssignment.get(segment);
+      Map<String, String> sortedIdealStateMap = 
convertToSortedMap(idealStateInstanceStateMap);
       Long newSegmentCreationTimeMs = newSegmentCreationTimeMap.get(segment);
       Map<String, String> externalViewInstanceStateMap = 
externalViewAssignment.get(segment);
+
+      // Build mapping from instance to position in ideal state (ideal state 
replica ID)
+      Map<String, Integer> instanceToIdealStateReplicaId = new HashMap<>();
+      int idealStateReplicaId = 0;
+      for (String instance : sortedIdealStateMap.keySet()) {

Review Comment:
   Hm yes but that would duplicate the logic in three different places for 
(IMO) little benefit (since these maps would be tiny in size - just the # of 
replicas per segment). Also this logic is not in the query hot path.



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