You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by rd...@apache.org on 2020/07/24 02:55:20 UTC
[bookkeeper] branch branch-4.11 updated: Issue 2264: Bookie cannot
perform Garbage Collection in case of corrupted EntryLogger file
This is an automated email from the ASF dual-hosted git repository.
rdhabalia pushed a commit to branch branch-4.11
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/branch-4.11 by this push:
new 8972fed Issue 2264: Bookie cannot perform Garbage Collection in case of corrupted EntryLogger file
8972fed is described below
commit 8972fed6cb92e66af61453ce7cdb3ee00422b863
Author: Enrico Olivelli <eo...@gmail.com>
AuthorDate: Fri Jul 24 04:53:56 2020 +0200
Issue 2264: Bookie cannot perform Garbage Collection in case of corrupted EntryLogger file
- in case of corrupted entry log file the bookie cannot perform GC
- handle the case of an unexpected negative entrysize
### Changes
Stop scanning the file
Master Issue: #2264
Reviewers: Jia Zhai <zh...@apache.org>, Rajan Dhabalia <rd...@apache.org>
This closes #2373 from eolivelli/fix/issue2264-corruptedfile
(cherry picked from commit 4376410a9299191388662b1131ad7452be47ee84)
Signed-off-by: rdhabalia <rd...@apache.org>
---
.../src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
index 0d7c861..bc16a19 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
@@ -1011,6 +1011,11 @@ public class EntryLogger {
// read the entry
data.clear();
+ if (entrySize < 0) {
+ LOG.warn("bad read for ledger entry from entryLog {}@{} (entry size {})",
+ entryLogId, pos, entrySize);
+ return;
+ }
data.capacity(entrySize);
int rc = readFromLogChannel(entryLogId, bc, data, pos);
if (rc != entrySize) {