This is an automated email from the ASF dual-hosted git repository.
zhaocong pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new f6d20716e7a [fix][broker] Make sure all inflight writes have finished
before completion of compaction (#21067)
f6d20716e7a is described below
commit f6d20716e7ae181355702ff02e323f906faffc38
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 6396b72b7dd..ba13705b807 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
@@ -276,6 +276,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);