snleee commented on code in PR #9774: URL: https://github.com/apache/pinot/pull/9774#discussion_r1018655342
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/BaseSegmentAssignment.java: ########## @@ -126,6 +127,15 @@ protected Pair<List<Map<String, Map<String, String>>>, Map<String, Map<String, S _logger.info("Rebalancing tier: {} for table: {} with bootstrap: {}, instance partitions: {}", tierName, _tableNameWithType, bootstrap, tierInstancePartitions); + + // Set the default assignment strategy in case if it not set already + // Assuming all tiers use the same assignment strategy + if (segmentAssignmentStrategy == null) { Review Comment: Given that `segmentAssignmentStrategy` is not annotated as `@Nullable`, we can assume that `segmentAssignmentStrategy` will never be `null` in the perspective of `BaseSegmentAssignment`. IMO, we should handle this null issue in the caller of this function, which is `RealtimeSegmentAssignment`. In `RealtimeSegmentAssignment`, we correctly handle for `OFFLINE/COMPLETED`; however, I think that the current code can pass `null` for `rebalanceTiers()` function. We should update the following part `RealtimeSegmentAssignment:L193`: ``` SegmentAssignmentStrategy segmentAssignmentStrategy = null; if (completedInstancePartitions != null) { // Gets Segment assignment strategy for instance partitions segmentAssignmentStrategy = SegmentAssignmentStrategyFactory .getSegmentAssignmentStrategy(_helixManager, _tableConfig, InstancePartitionsType.COMPLETED.toString(), completedInstancePartitions); } ``` -- 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