shauryachats commented on code in PR #15843:
URL: https://github.com/apache/pinot/pull/15843#discussion_r2106085638
##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/MultiStageReplicaGroupSelector.java:
##########
@@ -99,58 +100,139 @@ Pair<Map<String, String>, Map<String, String>>
select(List<String> segments, int
} else {
replicaGroupSelected = requestId %
instancePartitions.getNumReplicaGroups();
}
- for (int iteration = 0; iteration <
instancePartitions.getNumReplicaGroups(); iteration++) {
- int replicaGroup = (replicaGroupSelected + iteration) %
instancePartitions.getNumReplicaGroups();
- try {
- return tryAssigning(segments, segmentStates, instancePartitions,
replicaGroup);
- } catch (Exception e) {
- LOGGER.warn("Unable to select replica-group {} for table: {}",
replicaGroup, _tableNameWithType, e);
+
+ return tryAssigning(Sets.newHashSet(segments), segmentStates,
instancePartitions, replicaGroupSelected);
Review Comment:
If the instance partitions are updated immediately on rebalance within a
single replica group, they might change. The delay in IS and EV updation might
not directly impact this routing strategy since instance partitions are
technically decoupled from IS and EV.
Instance Partitions -> Set of instances belonging to a particular partition
and replica group.
IS/EV -> Mapping of segments to the list of segments (one per replica group)
and the associated state with them.
Since the `tryAssigning` takes in the `instancePartitions` and
`segmentStates` (which determine the list of instances available for a segment
and do not directly tie to the instance partitions), an immediate change in
`instancePartitions` is unlikely to cause any `replica group not found` errors.
Inside `tryAssigning,` the segments and instances are correctly mapped to
the relevant partition ID; hence, any change in partitioning should be
correctly reflected in the new partition ID for both segments and 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]