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 2021/12/23 20:50:49 UTC

[GitHub] [bookkeeper] pkumar-singh commented on a change in pull request #2946: bug fix for EntryLocationIndex.getLastEntryInLedger

pkumar-singh commented on a change in pull request #2946:
URL: https://github.com/apache/bookkeeper/pull/2946#discussion_r774774180



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/EntryLocationIndex.java
##########
@@ -93,9 +93,16 @@ public long getLocation(long ledgerId, long entryId) throws IOException {
     public long getLastEntryInLedger(long ledgerId) throws IOException {
         if (deletedLedgers.contains(ledgerId)) {
             // Ledger already deleted
-            return -1;
+            if (log.isDebugEnabled()) {

Review comment:
       I think you are changing the  semantics of this method.
   As far as I could see. 
   Last Entry ID -1 means ledger is deleted. 
   ```
   for (entryId = firstEntryId; entryId < lastEntryId; entryId++) {
      // do somehting.
   }
   ```
   
   Since Last Entry ID is -1 it will not go in the for loop.  Throwing Bookie.NoEntryException might have undesirable effect in this case.
   
   However, Bookie.NoEntryException is thrown when EntryID is valid but it does not exist. 
   




-- 
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