zhangyue19921010 commented on a change in pull request #3536: URL: https://github.com/apache/hudi/pull/3536#discussion_r696258610
########## File path: hudi-common/src/main/java/org/apache/hudi/common/table/view/AbstractTableFileSystemView.java ########## @@ -212,7 +212,15 @@ private void resetFileGroupsReplaced(HoodieTimeline timeline) { hoodieTimer.startTimer(); // for each REPLACE instant, get map of (partitionPath -> deleteFileGroup) HoodieTimeline replacedTimeline = timeline.getCompletedReplaceTimeline(); - Stream<Map.Entry<HoodieFileGroupId, HoodieInstant>> resultStream = replacedTimeline.getInstants().flatMap(instant -> { + Stream<Map.Entry<HoodieFileGroupId, HoodieInstant>> resultStream = replacedTimeline.getInstants().filter(instant -> { + try { + // Replace instant could be deleted by archive in timeline + // So that we need to check if the replace commit files were existed. + return metaClient.getFs().exists(new Path(metaClient.getMetaPath(), instant.getFileName())); Review comment: Nice catch ! Maybe just catch the FileNotFoundException is not good enough, and there may other IOExceptions beside FileNotFoundException be threw during `getInstantDetails` because of archive deleting commit files. Just changed and catch the HoodieIOException threw from getInstantDetails. -- 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...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org