You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/07/26 10:54:46 UTC

[GitHub] [bookkeeper] hangc0276 commented on a diff in pull request #2903: ISSUE-2770: Code refactor calling ledgerExists two times.

hangc0276 commented on code in PR #2903:
URL: https://github.com/apache/bookkeeper/pull/2903#discussion_r929819389


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SortedLedgerStorage.java:
##########
@@ -144,9 +144,7 @@ public boolean ledgerExists(long ledgerId) throws IOException {
         // the O(1) for the ledgerCache.
         if (!interleavedLedgerStorage.ledgerExists(ledgerId)) {
             EntryKeyValue kv = memTable.getLastEntry(ledgerId);
-            if (null == kv) {
-                return interleavedLedgerStorage.ledgerExists(ledgerId);

Review Comment:
   Is there any case that line 145 returns `false`, but line 148 returns `true`?



-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org