KKcorps commented on code in PR #15347:
URL: https://github.com/apache/pinot/pull/15347#discussion_r2011862970


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -867,28 +868,31 @@ private SegmentZKMetadata 
updateCommittingSegmentZKMetadataToCOMMITTING(String r
   }
 
   /**
-   * Updates segment ZK metadata for the committing segment.
+   * Updates segment ZK metadata for the committing segment to status DONE.
    */
-  private SegmentZKMetadata updateCommittingSegmentZKMetadata(String 
realtimeTableName,
+  private SegmentZKMetadata updateCommittingSegmentZKMetadataToDone(String 
realtimeTableName,
       CommittingSegmentDescriptor committingSegmentDescriptor) {
     String segmentName = committingSegmentDescriptor.getSegmentName();
+
     Stat stat = new Stat();
     SegmentZKMetadata committingSegmentZKMetadata = 
getSegmentZKMetadata(realtimeTableName, segmentName, stat);
     // The segment status can be:
     // 1. IN_PROGRESS for normal tables
     // 2. COMMITTING for pauseless tables
-    Preconditions.checkState(committingSegmentZKMetadata.getStatus() != 
Status.DONE,
-        "Segment status for segment: %s should not be DONE", segmentName);
+    Status status = committingSegmentZKMetadata.getStatus();
+    Preconditions.checkState(status == Status.IN_PROGRESS || status == 
Status.COMMITTING,

Review Comment:
   We should have a check for pauseless enabled as well in addition to 
IN_PROGRESS. For pauseless tables, we should not jump directly to DONE from 
IN_PROGRESS



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