commit | 533dd5d6e9d3ac9b24d2462f6ae4d4240a4bffdf | [log] [tgz] |
---|---|---|
author | Ivan Kelly <ivank@apache.org> | Thu Jun 20 14:36:11 2019 +0200 |
committer | GitHub <noreply@github.com> | Thu Jun 20 14:36:11 2019 +0200 |
tree | 15a25d1189a4e56960951622dd8cf9f1a3456ee0 | |
parent | f719fb002b6f4f1d73c944e7d3a39d39f79b581c [diff] |
[DLOG] Delete empty inprogress segment on recovery This addresses an issue, whereby if a user is using getLastTxId() to find the first txnid when starting to write, they will continue to be able to write if the last segment written by the previous writer was empty. If the last segment was empty, then the maxTxId would be higher than the result of getLastTxId(). maxTxId is read from a znode, while getLastTxId() reads the txid of the last persisted record. In the case of an empty inprogress segment, the maxTxId znode was being updated with the expected first transaction id of the segment. This patch addresses the issue with the following changes: 1. The maxTxId znode is only updated when inprogress segment is completed, so it's value always refers to a transaction that exists. 2. On recovery, if the inprogress segment is empty, delete it. There was a TODO comment to do this already there. 3. When generating the sequence number, allow a potential sequence number which is equal to the current max sequence number, as this can be the case where recovery deleted an inprogress empty segment. Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Sijie Guo <sijie@apache.org> This closes #2099 from ivankelly/txnid-issue
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.