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


##########
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:
   We don't always loop over IS though - see these two cases:
   
   - `(externalViewInstanceStateMap == null)` and `(newSegmentCreationTimeMs == 
null)`
   - `(externalViewInstanceStateMap != null)` and `(newSegmentCreationTimeMs == 
null)` (only loop over online instances).



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