Akanksha-kedia commented on code in PR #18715:
URL: https://github.com/apache/pinot/pull/18715#discussion_r3381299186
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/generator/BaseTaskGenerator.java:
##########
@@ -180,9 +180,10 @@ public List<SegmentZKMetadata>
getNonConsumingSegmentsZKMetadataForRealtimeTable
List<SegmentZKMetadata> selectedSegmentZKMetadataList = new ArrayList<>();
for (SegmentZKMetadata segmentZKMetadata : segmentZKMetadataList) {
String segmentName = segmentZKMetadata.getSegmentName();
+ Map<String, String> instanceStateMap =
idealState.getInstanceStateMap(segmentName);
if (idealStateSegments.contains(segmentName)
&& segmentZKMetadata.getStatus().isCompleted() // skip consuming
segments
- &&
!idealState.getInstanceStateMap(segmentName).containsValue(SegmentStateModel.CONSUMING))
{
+ && (instanceStateMap == null ||
!instanceStateMap.containsValue(SegmentStateModel.CONSUMING))) {
Review Comment:
You're absolutely right — thank you for catching this. I had the null case
backwards. When `instanceStateMap == null` the segment is in exactly the broken
edge case the comment describes (partition in IdealState but no instance
assignments), so we must **not** schedule minion work and should let
`RealtimeSegmentValidationManager` repair it first.
Fixed in the latest commit: condition is now `instanceStateMap != null &&
!instanceStateMap.containsValue(CONSUMING)`.
--
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]