BackendArchitectX commented on code in PR #19915:
URL: https://github.com/apache/pinot/pull/19915#discussion_r4345291143
##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/ReplicaGroupInstanceSelector.java:
##########
@@ -292,8 +336,8 @@ void updateSegmentMapsForUpsertTable(IdealState idealState,
ExternalView externa
Set<String> onlineInstances = entry.getValue()._onlineInstances;
Map<String, String> idealStateInstanceStateMap =
idealStateAssignment.get(segment);
Map<String, String> sortedIdealStateInstanceStateMap =
sortByKeyIfNeeded(idealStateInstanceStateMap);
- Set<String> unavailableInstances =
-
unavailableInstancesMap.getOrDefault(idealStateInstanceStateMap.keySet(),
Set.of());
+ Set<String> unavailableInstances = unavailableInstancesMap.getOrDefault(
+ new InstanceSetKey(idealStateInstanceStateMap.keySet()), Set.of());
Review Comment:
Good point. The additional allocation is worth considering, especially for
large segment counts. I'd prefer to keep the implementation simple for now and
validate the tradeoff with a representative routing-rebuild benchmark before
introducing caching or further optimization.
--
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]