GitHub user sijie opened a pull request: https://github.com/apache/bookkeeper/pull/205
Improve ledger fence logic Descriptions of the changes in this PR: Problem: When bookie receive a fence request and couldn't find any writable dirs for the new index file, it will throw exception. This behavior can be improved, because as long as ledger fence request be persisted in Journal, we can say the fence request succeed. It should not depends on the success of flushing new index file. Solution: - Add option to fall back to pick from all directories regardless of writable or not when we getFileInfo for a new ledger - Return success only when ledger fence request has been persisted in Journal --- Be sure to do all of the following to help us incorporate your contribution quickly and easily: - [x] Make sure the PR title is formatted like: `<Issue #>: Description of pull request` `e.g. Issue 123: Description ...` - [x] Make sure tests pass via `mvn clean apache-rat:check install findbugs:check`. - [x] Replace `<Issue #>` in the title with the actual Issue number, if there is one. --- You can merge this pull request into a Git repository by running: $ git pull https://github.com/sijie/bookkeeper improve_fencing_behavior Alternatively you can review and apply these changes as the patch at: https://github.com/apache/bookkeeper/pull/205.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #205 ---- commit 7ccee25a02c8be527cb9e2d9903911790fbf2249 Author: Yiming Zang <yz...@twitter.com> Date: 2016-11-21T08:15:57Z Improve ledger fence logic Summary: Problem: When bookie receive a fence request and couldn't find any writable dirs for the new index file, it will throw exception. This behavior can be improved, because as long as ledger fence request be persisted in Journal, we can say the fence request succeed. It should not depends on the success of flushing new index file. Bug fix: - Add option to fall back to pick from all directories regardless of writable or not when we getFileInfo for a new ledger - Return success only when ledger fence request has been persisted in Journal Test Plan: Pass all unit tests Reviewers: psu, jbull, fcuny, drusek, mpatidar, sijieg, lstewart Reviewed By: sijieg, lstewart Subscribers: #rb_ds-messaging Differential Revision: https://phabricator.twitter.biz/D12978 JIRA Issues: PUBSUB-17855 ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---