noob-se7en commented on code in PR #14908:
URL: https://github.com/apache/pinot/pull/14908#discussion_r1927440143


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -1985,6 +1986,18 @@ private Set<String> findConsumingSegments(IdealState 
idealState) {
   public PauseStatusDetails getPauseStatusDetails(String tableNameWithType) {
     IdealState idealState = getIdealState(tableNameWithType);
     Set<String> consumingSegments = findConsumingSegments(idealState);
+    // For pauseless tables, a segment marked ONLINE in the ideal state may 
not have been committed yet.
+    // We rely on SegmentZkMetadata to determine whether a segment has been 
committed (status is DONE)
+    // instead of relying solely on the ideal state.
+    // A segment in COMMITTING state is treated as consuming for pauseStatus.
+    if 
(PauselessConsumptionUtils.isPauselessEnabled(getTableConfig(tableNameWithType)))
 {
+      getLatestSegmentZKMetadataMap(tableNameWithType).values()
+          .stream()
+          .filter(segmentZKMetadata -> 
!consumingSegments.contains(segmentZKMetadata.getSegmentName()))
+          .filter(segmentZKMetadata -> segmentZKMetadata.getStatus() == 
Status.COMMITTING)
+          .map(SegmentZKMetadata::getSegmentName)
+          .forEach(consumingSegments::add);

Review Comment:
   (minor) probably we should add this check in `findConsumingSegments` method 
itself (or override findConsumingSegments).



-- 
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]

Reply via email to