This is an automated email from the ASF dual-hosted git repository.
zhaocong pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 25f76efee83 [fix][broker] Make sure all inflight writes have finished
before completion of compaction (#21067)
25f76efee83 is described below
commit 25f76efee83a297f04c3f9237bdbf73f268453c2
Author: Cong Zhao <[email protected]>
AuthorDate: Mon Aug 28 09:42:22 2023 +0800
[fix][broker] Make sure all inflight writes have finished before
completion of compaction (#21067)
(cherry picked from commit bb9c9b421b02c5f88fdd508ede387686065388f5)
---
.../src/main/java/org/apache/pulsar/compaction/TwoPhaseCompactor.java | 2 ++
1 file changed, 2 insertions(+)
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/compaction/TwoPhaseCompactor.java
b/pulsar-broker/src/main/java/org/apache/pulsar/compaction/TwoPhaseCompactor.java
index d71227d94f5..886a523df02 100644
---
a/pulsar-broker/src/main/java/org/apache/pulsar/compaction/TwoPhaseCompactor.java
+++
b/pulsar-broker/src/main/java/org/apache/pulsar/compaction/TwoPhaseCompactor.java
@@ -278,6 +278,8 @@ public class TwoPhaseCompactor extends Compactor {
}
});
if (to.equals(id)) {
+ // make sure all inflight writes have finished
+ outstanding.acquire(MAX_OUTSTANDING);
addFuture.whenComplete((res, exception2) -> {
if (exception2 == null) {
promise.complete(null);