This is an automated email from the ASF dual-hosted git repository. danny0405 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push: new e6bd6a17ab9 [HUDI-9347] Handle archived clean instants in meta-sync for droppedPartitions (#13235) e6bd6a17ab9 is described below commit e6bd6a17ab9ce8c93ae04ced9a2cd4efec0f8f70 Author: Vinish Reddy <vinishreddygunne...@gmail.com> AuthorDate: Tue Apr 29 06:58:40 2025 +0530 [HUDI-9347] Handle archived clean instants in meta-sync for droppedPartitions (#13235) --- .../java/org/apache/hudi/common/table/timeline/TimelineUtils.java | 7 +++++++ .../test/java/org/apache/hudi/common/table/TestTimelineUtils.java | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimelineUtils.java b/hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimelineUtils.java index ad374306cbb..5fc87292c75 100644 --- a/hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimelineUtils.java +++ b/hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimelineUtils.java @@ -44,6 +44,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.text.ParseException; @@ -133,6 +134,12 @@ public class TimelineUtils { partitionToLatestDeleteTimestamp.put(partition, instant.requestedTime()); } }); + } catch (HoodieIOException e) { + if (e.getCause() instanceof FileNotFoundException) { + LOG.warn("Instant {} not found in storage and has been archived", instant); + } else { + throw e; + } } catch (IOException e) { throw new HoodieIOException("Failed to get partitions cleaned at " + instant, e); } diff --git a/hudi-hadoop-common/src/test/java/org/apache/hudi/common/table/TestTimelineUtils.java b/hudi-hadoop-common/src/test/java/org/apache/hudi/common/table/TestTimelineUtils.java index a6ed90c7165..82cee2e572f 100644 --- a/hudi-hadoop-common/src/test/java/org/apache/hudi/common/table/TestTimelineUtils.java +++ b/hudi-hadoop-common/src/test/java/org/apache/hudi/common/table/TestTimelineUtils.java @@ -616,5 +616,10 @@ public class TestTimelineUtils extends HoodieCommonTestHarness { // older partition is in the list dropped partitions assertEquals(1, droppedPartitions.size()); assertEquals(olderPartition, droppedPartitions.get(0)); + + // Archive clean instant. + activeTimeline.deleteInstantFileIfExists(metaClient.getActiveTimeline().getCleanerTimeline().filterCompletedInstants().lastInstant().get()); + droppedPartitions = TimelineUtils.getDroppedPartitions(metaClient, Option.empty(), Option.empty()); + assertTrue(droppedPartitions.isEmpty()); } }