Jackie-Jiang commented on code in PR #15316: URL: https://github.com/apache/pinot/pull/15316#discussion_r2004547568
########## pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java: ########## @@ -564,77 +562,59 @@ private void doAddConsumingSegment(String segmentName) @Override public File downloadSegment(SegmentZKMetadata zkMetadata) throws Exception { - Preconditions.checkState(zkMetadata.getStatus() != Status.IN_PROGRESS, - "Segment: %s is still IN_PROGRESS and cannot be downloaded", zkMetadata.getSegmentName()); + String segmentName = zkMetadata.getSegmentName(); + Status status = zkMetadata.getStatus(); + Preconditions.checkState(status != Status.IN_PROGRESS, "Segment: %s is still IN_PROGRESS and cannot be downloaded", + segmentName); - // Case: The commit protocol has completed, and the segment is ready to be downloaded either - // from deep storage or from a peer (if peer-to-peer download is enabled). - if (zkMetadata.getStatus() == Status.DONE) { + // The commit protocol has completed, and the segment is ready to be downloaded either from deep storage or from a + // peer (if peer-to-peer download is enabled). + if (status.isCompleted()) { Review Comment: This is an important fix -- 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