This is an automated email from the ASF dual-hosted git repository.
eolivelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 6e268800c5 reduce unnecessary checkpoints (#3341)
6e268800c5 is described below
commit 6e268800c5d5d8f6c250202feed68fb38964251e
Author: LinChen <[email protected]>
AuthorDate: Mon Jun 20 15:01:47 2022 +0800
reduce unnecessary checkpoints (#3341)
---
.../bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
index 7aeea2bc6d..30516f82c6 100644
---
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
+++
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
@@ -707,6 +707,9 @@ public class SingleDirectoryDbLedgerStorage implements
CompactableLedgerStorage
// Only a single flush operation can happen at a time
flushMutex.lock();
try {
+ if (writeCache.isEmpty()) {
+ return;
+ }
// Swap the write cache so that writes can continue to happen
while the flush is
// ongoing
swapWriteCache();