Skip to content

Commit 454a41c

Browse files
dlg99priyanshu-ctds
authored andcommitted
Fix: Garbage collection stuck on corrupt entry log file (apache#4544)
(cherry picked from commit 175e294) (cherry picked from commit d89930a)
1 parent 76f85a0 commit 454a41c

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

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

0 commit comments

Comments
 (0)