massakam commented on a change in pull request #2844:
URL: https://github.com/apache/bookkeeper/pull/2844#discussion_r735219876



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
##########
@@ -234,9 +234,19 @@ public void gc(GarbageCleaner garbageCleaner) {
                 // check ledger ensembles before creating lock nodes.
                 // 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
                 Versioned<LedgerMetadata> preCheckMetadata = 
ledgerManager.readLedgerMetadata(ledgerId).get();
-                if (!isNotBookieIncludedInLedgerEnsembles(preCheckMetadata) || 
lum.isLedgerBeingReplicated(ledgerId)) {
+                if (!isNotBookieIncludedInLedgerEnsembles(preCheckMetadata)) {
+                    latch.countDown();
+                    continue;
+                }
+            } catch (Throwable t) {
+                latch.countDown();
+                continue;

Review comment:
       Exceptions other than `BKNoSuchLedgerExistsException` may be thrown, so 
it would be better to output the WARN log. There is also an option not to 
output the log only when the cause is `BKNoSuchLedgerExistsException`:
   ```java
   } catch (Throwable t) {
       if (!(t.getCause() instanceof BKNoSuchLedgerExistsException)) {
           LOG.warn("...");
       }
       latch.countDown();
       continue;
   }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to