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