From 0057538b8fc626cf4698274ccfbd71eb9d66b621 Mon Sep 17 00:00:00 2001 From: Jingsong Lee Date: Fri, 22 Nov 2024 19:05:39 +0800 Subject: [PATCH] [core] Ensure triggerCompaction in RecordWriter.isCompacting (#4574) --- .../src/main/java/org/apache/paimon/append/AppendOnlyWriter.java | 1 + .../main/java/org/apache/paimon/mergetree/MergeTreeWriter.java | 1 + 2 files changed, 2 insertions(+) diff --git a/paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyWriter.java b/paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyWriter.java index 47502aa707d1..a3087e362864 100644 --- a/paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyWriter.java +++ b/paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyWriter.java @@ -211,6 +211,7 @@ public CommitIncrement prepareCommit(boolean waitCompaction) throws Exception { @Override public boolean isCompacting() { + compactManager.triggerCompaction(false); return compactManager.isCompacting(); } diff --git a/paimon-core/src/main/java/org/apache/paimon/mergetree/MergeTreeWriter.java b/paimon-core/src/main/java/org/apache/paimon/mergetree/MergeTreeWriter.java index b73be6941e54..f2a964bae16a 100644 --- a/paimon-core/src/main/java/org/apache/paimon/mergetree/MergeTreeWriter.java +++ b/paimon-core/src/main/java/org/apache/paimon/mergetree/MergeTreeWriter.java @@ -279,6 +279,7 @@ public CommitIncrement prepareCommit(boolean waitCompaction) throws Exception { @Override public boolean isCompacting() { + compactManager.triggerCompaction(false); return compactManager.isCompacting(); }