You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by lu...@apache.org on 2023/04/07 09:08:35 UTC

[bookkeeper] branch revert-3772-fix-checkpoint created (now 306a42af6f)

This is an automated email from the ASF dual-hosted git repository.

lushiji pushed a change to branch revert-3772-fix-checkpoint
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


      at 306a42af6f Revert "Execute clean indexes in finally (#3772)"

This branch includes the following new commits:

     new 306a42af6f Revert "Execute clean indexes in finally (#3772)"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[bookkeeper] 01/01: Revert "Execute clean indexes in finally (#3772)"

Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lushiji pushed a commit to branch revert-3772-fix-checkpoint
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 306a42af6f66b75511860198a8788049fe977e5e
Author: StevenLuMT <ls...@126.com>
AuthorDate: Fri Apr 7 17:08:30 2023 +0800

    Revert "Execute clean indexes in finally (#3772)"
    
    This reverts commit 04e572b9bccd1502c0f2c4a87f23d760d4d0d9b5.
---
 .../ldb/SingleDirectoryDbLedgerStorage.java        | 29 +++++++++++-----------
 1 file changed, 15 insertions(+), 14 deletions(-)

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 9f089d9864..635a2727f9 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
@@ -824,6 +824,21 @@ public class SingleDirectoryDbLedgerStorage implements CompactableLedgerStorage
             ledgerIndex.flush();
             recordSuccessfulEvent(dbLedgerStorageStats.getFlushLedgerIndexStats(), ledgerIndexStartTime);
 
+            cleanupExecutor.execute(() -> {
+                // There can only be one single cleanup task running because the cleanupExecutor
+                // is single-threaded
+                try {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Removing deleted ledgers from db indexes");
+                    }
+
+                    entryLocationIndex.removeOffsetFromDeletedLedgers();
+                    ledgerIndex.removeDeletedLedgers();
+                } catch (Throwable t) {
+                    log.warn("Failed to cleanup db indexes", t);
+                }
+            });
+
             lastCheckpoint = thisCheckpoint;
 
             // Discard all the entry from the write cache, since they're now persisted
@@ -843,20 +858,6 @@ public class SingleDirectoryDbLedgerStorage implements CompactableLedgerStorage
             // Leave IOExecption as it is
             throw e;
         } finally {
-            cleanupExecutor.execute(() -> {
-                // There can only be one single cleanup task running because the cleanupExecutor
-                // is single-threaded
-                try {
-                    if (log.isDebugEnabled()) {
-                        log.debug("Removing deleted ledgers from db indexes");
-                    }
-
-                    entryLocationIndex.removeOffsetFromDeletedLedgers();
-                    ledgerIndex.removeDeletedLedgers();
-                } catch (Throwable t) {
-                    log.warn("Failed to cleanup db indexes", t);
-                }
-            });
             try {
                 isFlushOngoing.set(false);
             } finally {