From 2a158098447f1ec5e49e7d0629ff21af02671991 Mon Sep 17 00:00:00 2001 From: Jingsong Date: Fri, 22 Nov 2024 16:43:48 +0800 Subject: [PATCH] [core] Ensure triggerCompaction in RecordWriter.isCompacting --- .../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(); }