diff --git a/hudi-common/src/main/java/org/apache/hudi/common/util/CommitUtils.java b/hudi-common/src/main/java/org/apache/hudi/common/util/CommitUtils.java index 6baacf1ec88f..ce94c92fd459 100644 --- a/hudi-common/src/main/java/org/apache/hudi/common/util/CommitUtils.java +++ b/hudi-common/src/main/java/org/apache/hudi/common/util/CommitUtils.java @@ -151,7 +151,7 @@ public static HashMap getFileIdWithoutSuffixAndRelativePaths(Map * @return An optional commit metadata with latest checkpoint. */ public static Option getLatestCommitMetadataWithValidCheckpointInfo(HoodieTimeline timeline, String checkpointKey) { - return (Option) timeline.getReverseOrderedInstants().map(instant -> { + return (Option) timeline.filterCompletedInstants().getReverseOrderedInstants().map(instant -> { try { HoodieCommitMetadata commitMetadata = HoodieCommitMetadata .fromBytes(timeline.getInstantDetails(instant).get(), HoodieCommitMetadata.class);