J-HowHuang commented on code in PR #15368: URL: https://github.com/apache/pinot/pull/15368#discussion_r2019277838
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalancer.java: ########## @@ -711,6 +750,15 @@ private RebalanceSummaryResult calculateDryRunSummary(Map<String, Map<String, St } } + if (existingServersToConsumingSegmentMap != null && newServersToConsumingSegmentMap != null) { + for (Map.Entry<String, Set<String>> entry : newServersToConsumingSegmentMap.entrySet()) { + String server = entry.getKey(); + entry.getValue().removeAll(existingServersToConsumingSegmentMap.getOrDefault(server, Collections.emptySet())); Review Comment: It's accessed only once each loop. And key removal from the map should be after the traversal here. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org