commit | f89e3fbb751fbef7012e695ed5873eade13ba4f5 | [log] [tgz] |
---|---|---|
author | karanmehta93 <k.mehta@salesforce.com> | Fri May 31 09:49:13 2019 -0500 |
committer | Enrico Olivelli <eolivelli@gmail.com> | Fri May 31 16:49:13 2019 +0200 |
tree | 53fdaf670022cb7dc1da698abc84fa6eb63e75d7 | |
parent | 26e8004e6b93f5acaff7f69dba14511a7cf44d58 [diff] |
Update lastLogMark to EOF when replaying journal 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 Reviewers: Ivan Kelly <ivank@apache.org>, Enrico Olivelli <eolivelli@gmail.com> This closes #2105 from karanmehta93/master
Apache BookKeeper is a scalable, fault tolerant and low latency storage service optimized for append-only workloads.
It is suitable for being used in following scenarios:
You can also read Turning Ledgers into Logs to learn how to turn ledgers into continuous log streams. If you are looking for a high level log stream API, you can checkout DistributedLog.
For filing bugs, suggesting improvements, or requesting new features, help us out by opening a Github issue or opening an Apache jira.
Subscribe or mail the user@bookkeeper.apache.org list - Ask questions, find answers, and also help other users.
Subscribe or mail the dev@bookkeeper.apache.org list - Join development discussions, propose new ideas and connect with contributors.
Join us on Slack - This is the most immediate way to connect with Apache BookKeeper committers and contributors.
We feel that a welcoming open community is important and welcome contributions.
See Developer Setup to get your local environment setup.
Take a look at our open issues: JIRA Issues Github Issues.
Review our coding style and follow our pull requests to learn about our conventions.
Make your changes according to our contribution guide.