This is an automated email from the ASF dual-hosted git repository. pwason pushed a commit to branch release-0.14.0 in repository https://gitbox.apache.org/repos/asf/hudi.git
commit 2538f544507a22421610c24b14bf441a848de4aa Author: ksmou <135721692+ks...@users.noreply.github.com> AuthorDate: Wed Aug 16 13:37:21 2023 +0800 [HUDI-6359] Spark offline compaction/clustering will never rollback when both requested and inflight states exist (#8944) Co-authored-by: Y Ethan Guo <ethan.guoyi...@gmail.com> --- .../src/main/java/org/apache/hudi/utilities/HoodieClusteringJob.java | 3 +-- .../src/main/java/org/apache/hudi/utilities/HoodieCompactor.java | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieClusteringJob.java b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieClusteringJob.java index 9abeafb88fd..a859d791b7b 100644 --- a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieClusteringJob.java +++ b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieClusteringJob.java @@ -212,8 +212,7 @@ public class HoodieClusteringJob { // Instant time is not specified // Find the earliest scheduled clustering instant for execution Option<HoodieInstant> firstClusteringInstant = - metaClient.getActiveTimeline().firstInstant( - HoodieTimeline.REPLACE_COMMIT_ACTION, HoodieInstant.State.REQUESTED); + metaClient.getActiveTimeline().filterPendingReplaceTimeline().firstInstant(); if (firstClusteringInstant.isPresent()) { cfg.clusteringInstantTime = firstClusteringInstant.get().getTimestamp(); LOG.info("Found the earliest scheduled clustering instant which will be executed: " diff --git a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieCompactor.java b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieCompactor.java index e7213f93a55..0b0d6307067 100644 --- a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieCompactor.java +++ b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieCompactor.java @@ -26,7 +26,6 @@ import org.apache.hudi.common.model.HoodieRecordPayload; import org.apache.hudi.common.table.HoodieTableMetaClient; import org.apache.hudi.common.table.TableSchemaResolver; import org.apache.hudi.common.table.timeline.HoodieInstant; -import org.apache.hudi.common.table.timeline.HoodieTimeline; import org.apache.hudi.common.util.Option; import org.apache.hudi.common.util.StringUtils; import org.apache.hudi.config.HoodieCleanConfig; @@ -263,8 +262,7 @@ public class HoodieCompactor { if (StringUtils.isNullOrEmpty(cfg.compactionInstantTime)) { HoodieTableMetaClient metaClient = UtilHelpers.createMetaClient(jsc, cfg.basePath, true); Option<HoodieInstant> firstCompactionInstant = - metaClient.getActiveTimeline().firstInstant( - HoodieTimeline.COMPACTION_ACTION, HoodieInstant.State.REQUESTED); + metaClient.getActiveTimeline().filterPendingCompactionTimeline().firstInstant(); if (firstCompactionInstant.isPresent()) { cfg.compactionInstantTime = firstCompactionInstant.get().getTimestamp(); LOG.info("Found the earliest scheduled compaction instant which will be executed: "