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/01/05 07:18:01 UTC

[GitHub] [bookkeeper] eolivelli commented on a change in pull request #2963: Add throttle for rebuild entryMetadataMap

eolivelli commented on a change in pull request #2963:
URL: https://github.com/apache/bookkeeper/pull/2963#discussion_r778592419



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
##########
@@ -1055,18 +1055,32 @@ public void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws IOExce
     }
 
     public EntryLogMetadata getEntryLogMetadata(long entryLogId) throws IOException {
-        // First try to extract the EntryLogMetada from the index, if there's no index then fallback to scanning the
+        // First try to extract the EntryLogMetadata from the index, if there's no index then fallback to scanning the
         // entry log
         try {
             return extractEntryLogMetadataFromIndex(entryLogId);
-        } catch (Exception e) {
+        } catch (IOException e) {
             LOG.info("Failed to get ledgers map index from: {}.log : {}", entryLogId, e.getMessage());
 
             // Fall-back to scanning
             return extractEntryLogMetadataByScanning(entryLogId);
         }
     }
 
+    public EntryLogMetadata getEntryLogMetadata(long entryLogId, AbstractLogCompactor.Throttler throttler)
+        throws IOException {
+        // First try to extract the EntryLogMetadata from the index, if there's no index then fallback to scanning the
+        // entry log
+        try {
+            return extractEntryLogMetadataFromIndex(entryLogId);

Review comment:
       I wonder if you could add a test that injects a failure here using PowerMock and test that the bookie works even if we fall into the catch clause




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