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 ! 
   changed.
   




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


Reply via email to