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 2019/05/30 22:09:56 UTC

[GitHub] [bookkeeper] karanmehta93 opened a new pull request #2105: Update lastLogMark to EOF when replaying journal

karanmehta93 opened a new pull request #2105: Update lastLogMark to EOF when replaying journal
URL: https://github.com/apache/bookkeeper/pull/2105
 
 
   Descriptions of the changes in this PR:
   
   ### Motivation
    
   The [commit](https://github.com/apache/bookkeeper/commit/36be8362399341022c8de64f9319270726df2cb3) caused integration test failure `test101_RegenerateIndex`, with the exception
   ```
   ```java.io.IOException: Invalid argument
       at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
       at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46)
       at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
       at sun.nio.ch.IOUtil.read(IOUtil.java:197)
       at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159)
       at org.apache.bookkeeper.bookie.JournalChannel.read(JournalChannel.java:257)
       at org.apache.bookkeeper.bookie.Journal.fullRead(Journal.java:1171)
       at org.apache.bookkeeper.bookie.Journal.scanJournal(Journal.java:792)
       at org.apache.bookkeeper.bookie.Bookie.replay(Bookie.java:924)
       at org.apache.bookkeeper.bookie.Bookie.readJournal(Bookie.java:886)
       at org.apache.bookkeeper.bookie.Bookie.start(Bookie.java:943)
       at org.apache.bookkeeper.proto.BookieServer.start(BookieServer.java:141)
       at org.apache.bookkeeper.server.service.BookieService.doStart(BookieService.java:58)
       at org.apache.bookkeeper.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:78)
       at org.apache.bookkeeper.common.component.LifecycleComponentStack.lambda$start$2(LifecycleComponentStack.java:113)
       at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:408)
       at org.apache.bookkeeper.common.component.LifecycleComponentStack.start(LifecycleComponentStack.java:113)
       at org.apache.bookkeeper.common.component.ComponentStarter.startComponent(ComponentStarter.java:80)
       at org.apache.bookkeeper.server.Main.doMain(Main.java:229)
       at org.apache.bookkeeper.server.Main.main(Main.java:203)
   ```
   
   As discussed on slack, it is hard to figure out an exact reason as to why the native JNI call fails with an invalid argument. Hence this PR proposes that the `lastLogMark` is updated to journal EOF instead of an arbitrary LONG.MAX_VALUE. The FileChannel interface defines that the implementors can pass in any long offset and the file handler should return EOF immediately when trying to read it. However it doesn't seem to be working as expected.
   
   ### Changes
   
   Updated `Journal#setLastLogMark()` method to accept an `scanOffset` instead of constant `LONG.MAX_VALUE`.
   
   @ivankelly @eolivelli 

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


With regards,
Apache Git Services