From 54ed452c939e7722d0b9b9e1aa7a9c1b1f2e1e09 Mon Sep 17 00:00:00 2001 From: "yuzhao.cyz" Date: Wed, 18 May 2022 15:15:23 +0800 Subject: [PATCH] Revert "[HUDI-3870] Add timeout rollback for flink online compaction (#5314)" This reverts commit 6f9b02decb5bb2b83709b1b6ec04a97e4d102c11. --- .../hudi/sink/compact/CompactionPlanOperator.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/compact/CompactionPlanOperator.java b/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/compact/CompactionPlanOperator.java index 338352d4b0c93..d5e718883b86c 100644 --- a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/compact/CompactionPlanOperator.java +++ b/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/compact/CompactionPlanOperator.java @@ -89,7 +89,8 @@ public void notifyCheckpointComplete(long checkpointId) { // when the earliest inflight instant has timed out, assumes it has failed // already and just rolls it back. - CompactionUtil.rollbackEarliestCompaction(table, conf); + // comment out: do we really need the timeout rollback ? + // CompactionUtil.rollbackEarliestCompaction(table, conf); scheduleCompaction(table, checkpointId); } catch (Throwable throwable) { // make it fail-safe @@ -99,8 +100,7 @@ public void notifyCheckpointComplete(long checkpointId) { private void scheduleCompaction(HoodieFlinkTable table, long checkpointId) throws IOException { // the first instant takes the highest priority. - HoodieTimeline pendingCompactionTimeline = table.getActiveTimeline().filterPendingCompactionTimeline(); - Option firstRequested = pendingCompactionTimeline + Option firstRequested = table.getActiveTimeline().filterPendingCompactionTimeline() .filter(instant -> instant.getState() == HoodieInstant.State.REQUESTED).firstInstant(); if (!firstRequested.isPresent()) { // do nothing. @@ -108,13 +108,6 @@ private void scheduleCompaction(HoodieFlinkTable table, long checkpointId) th return; } - Option firstInflight = pendingCompactionTimeline - .filter(instant -> instant.getState() == HoodieInstant.State.INFLIGHT).firstInstant(); - if (firstInflight.isPresent()) { - LOG.warn("Waiting for pending compaction instant : " + firstInflight + " to complete, skip scheduling new compaction plans"); - return; - } - String compactionInstantTime = firstRequested.get().getTimestamp(); // generate compaction plan