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 2021/03/17 01:38:47 UTC

[GitHub] [bookkeeper] merlimat opened a new pull request #2649: Exception in BK GC with corrupted data files

merlimat opened a new pull request #2649:
URL: https://github.com/apache/bookkeeper/pull/2649


   ### Motivation
   
   In case of corrupted entry log, this exception can show up during the compaction phase: 
   
   ```
   18:53:37.224 [GarbageCollectorThread-7-1] ERROR org.apache.bookkeeper.bookie.GarbageCollectorThread - Failed to compact entry log 16 due to unexpected error
   java.lang.IndexOutOfBoundsException: index: 8, length: 8 (expected: range(0, 0))
   	at io.netty.buffer.AbstractByteBuf.checkRangeBounds(AbstractByteBuf.java:1425) ~[netty-buffer-4.1.51.Final.jar:4.1.51.Final]
   	at io.netty.buffer.AbstractByteBuf.checkIndex0(AbstractByteBuf.java:1432) ~[netty-buffer-4.1.51.Final.jar:4.1.51.Final]
   	at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1419) ~[netty-buffer-4.1.51.Final.jar:4.1.51.Final]
   	at io.netty.buffer.UnpooledUnsafeDirectByteBuf.getLong(UnpooledUnsafeDirectByteBuf.java:144) ~[netty-buffer-4.1.51.Final.jar:4.1.51.Final]
   	at org.apache.bookkeeper.bookie.EntryLogCompactor$CompactionScannerFactory$1.process(EntryLogCompactor.java:103) ~[bookkeeper-server-4.11.0.SPLK.8715995.jar:?]
   	at org.apache.bookkeeper.bookie.EntryLogger.scanEntryLog(EntryLogger.java:1011) ~[bookkeeper-server-4.11.0.SPLK.8715995.jar:?]
   	at org.apache.bookkeeper.bookie.EntryLogCompactor.compact(EntryLogCompactor.java:64) ~[bookkeeper-server-4.11.0.SPLK.8715995.jar:?]
   	at org.apache.bookkeeper.bookie.GarbageCollectorThread.compactEntryLog(GarbageCollectorThread.java:528) [bookkeeper-server-4.11.0.SPLK.8715995.jar:?]
   	at org.apache.bookkeeper.bookie.GarbageCollectorThread.doCompactEntryLogs(GarbageCollectorThread.java:462) [bookkeeper-server-4.11.0.SPLK.8715995.jar:?]
   	at org.apache.bookkeeper.bookie.GarbageCollectorThread.runWithFlags(GarbageCollectorThread.java:367) [bookkeeper-server-4.11.0.SPLK.8715995.jar:?]
   	at org.apache.bookkeeper.bookie.GarbageCollectorThread.safeRun(GarbageCollectorThread.java:316) [bookkeeper-server-4.11.0.SPLK.8715995.jar:?]
   	at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [bookkeeper-common-4.11.0.SPLK.8715995.jar:?]
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
   	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_232]
   	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_232]
   	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_232]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.51.Final.jar:4.1.51.Final]
   	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
   ```


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] merlimat commented on a change in pull request #2649: Exception in BK GC with corrupted data files

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #2649:
URL: https://github.com/apache/bookkeeper/pull/2649#discussion_r628572443



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
##########
@@ -1009,6 +1009,9 @@ public void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws IOExce
                     continue;
                 }
                 // read the entry
+                if (entrySize == 0) {

Review comment:
       Yes, it's probably better to log it when it happens




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] eolivelli commented on a change in pull request #2649: Exception in BK GC with corrupted data files

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #2649:
URL: https://github.com/apache/bookkeeper/pull/2649#discussion_r595764040



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
##########
@@ -1009,6 +1009,9 @@ public void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws IOExce
                     continue;
                 }
                 // read the entry
+                if (entrySize == 0) {

Review comment:
       Why aren't you doing the same as at line 1017?
   We should log and return 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] merlimat merged pull request #2649: Exception in BK GC with corrupted data files

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #2649:
URL: https://github.com/apache/bookkeeper/pull/2649


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] dlg99 commented on a change in pull request #2649: Exception in BK GC with corrupted data files

Posted by GitBox <gi...@apache.org>.
dlg99 commented on a change in pull request #2649:
URL: https://github.com/apache/bookkeeper/pull/2649#discussion_r628569295



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
##########
@@ -1009,6 +1009,9 @@ public void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws IOExce
                     continue;
                 }
                 // read the entry
+                if (entrySize == 0) {

Review comment:
       Alternatively, just do `if (entrySize <= 0)` instead of `if (entrySize < 0)` a couple of lines below




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org