From 5be03cfdfb4dbe4ad37bd2502fe514d9b347cd26 Mon Sep 17 00:00:00 2001 From: qinyuren Date: Mon, 11 Dec 2023 14:21:29 +0800 Subject: [PATCH] when setExplicitLac is called the ledgersCount should increased (#4138) The **ledgersCount.incrementAndGet** should be called in **setExplicitLac** , just like in **setFenced** and **setLimbo**. --- .../bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java index d733bf35fc3..0f615ab6752 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java @@ -403,6 +403,7 @@ void setExplicitLac(long ledgerId, ByteBuf lac) throws IOException { if (ledgers.put(ledgerId, newLedgerData) == null) { // Ledger had been deleted + ledgersCount.incrementAndGet(); return; } else if (log.isDebugEnabled()) { log.debug("Set explicitLac on ledger {}", ledgerId);