Skip to content

Commit 175e294

Browse files
authored
Fix: Garbage collection stuck on corrupt entry log file (#4544)
1 parent 6ee47c4 commit 175e294

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,13 @@ protected void extractMetaFromEntryLogs() throws EntryLogMetadataMapException {
823823
entryLogMetaMap.put(entryLogId, entryLogMeta);
824824
}
825825
} catch (IOException | RuntimeException e) {
826-
LOG.warn("Premature exception when processing " + entryLogId
827-
+ " recovery will take care of the problem", e);
826+
LOG.warn("Premature exception when processing {} recovery will take care of the problem",
827+
entryLogId, e);
828+
} catch (OutOfMemoryError oome) {
829+
// somewhat similar to https://github.com/apache/bookkeeper/pull/3901
830+
// entrylog file can be corrupted but instead having a negative entry size
831+
// it ends up with very large value for the entry size causing OODME
832+
LOG.warn("OutOfMemoryError when processing {} - skipping the entry log", entryLogId, oome);
828833
}
829834
}
830835
}

0 commit comments

Comments
 (0)