From 728fbba98412dea4f52f9281f0dfa00611b27cf3 Mon Sep 17 00:00:00 2001 From: shustsud Date: Mon, 18 Oct 2021 16:51:06 +0900 Subject: [PATCH] Moved readLedgerMetadata --- .../bookkeeper/bookie/ScanAndCompareGarbageCollector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java index 0261d0314e5..4c778a13b35 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java @@ -235,8 +235,8 @@ private Set removeOverReplicatedledgers(Set bkActiveledgers, final G // this is to reduce the number of lock node creations and deletions in ZK. // the ensemble check is done again after the lock node is created. // also, check if the ledger is being replicated already by the replication worker - if (!isNotBookieIncludedInLedgerEnsembles(ledgerManager.readLedgerMetadata(ledgerId).get()) - || lum.isLedgerBeingReplicated(ledgerId)) { + Versioned preCheckMetadata = ledgerManager.readLedgerMetadata(ledgerId).get(); + if (!isNotBookieIncludedInLedgerEnsembles(preCheckMetadata) || lum.isLedgerBeingReplicated(ledgerId)) { latch.countDown(); continue; }