You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by yo...@apache.org on 2025/08/11 09:41:08 UTC

(bookkeeper) branch branch-4.16 updated: Fix: Garbage collection stuck on corrupt entry log file (#4544)

This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.16
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/branch-4.16 by this push:
     new 7733db1c9a Fix: Garbage collection stuck on corrupt entry log file (#4544)
7733db1c9a is described below

commit 7733db1c9a673371301d585e3d0e35c44d4110f9
Author: Andrey Yegorov <86...@users.noreply.github.com>
AuthorDate: Thu Feb 13 11:41:21 2025 -0800

    Fix: Garbage collection stuck on corrupt entry log file (#4544)
    
    (cherry picked from commit 175e29407ece25fbb50d52afbcca384f2182e058)
---
 .../org/apache/bookkeeper/bookie/GarbageCollectorThread.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
index d70082256f..41eb1d941f 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
@@ -809,8 +809,13 @@ public class GarbageCollectorThread implements Runnable {
                     entryLogMetaMap.put(entryLogId, entryLogMeta);
                 }
             } catch (IOException | RuntimeException e) {
-                LOG.warn("Premature exception when processing " + entryLogId
-                         + " recovery will take care of the problem", e);
+                LOG.warn("Premature exception when processing {} recovery will take care of the problem",
+                        entryLogId, e);
+            } catch (OutOfMemoryError oome) {
+                // somewhat similar to https://github.com/apache/bookkeeper/pull/3901
+                // entrylog file can be corrupted but instead having a negative entry size
+                // it ends up with very large value for the entry size causing OODME
+                LOG.warn("OutOfMemoryError when processing {} - skipping the entry log", entryLogId, oome);
             }
         }
     }