-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix bk write failure part 2 #5322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bk write failure part 2 #5322
Conversation
…bk_write_failure_part_2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be some managed ledger unit tests that are dependent on the old behavior. We should fix them and add a new one to just test the readyToCreateNewLedger()
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Show resolved
Hide resolved
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerErrorsTest.java
Show resolved
Hide resolved
474607e
to
8fb9c7d
Compare
run java8 tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerErrorsTest.java
Show resolved
Hide resolved
if (exception instanceof ManagedLedgerFencedException) { | ||
// If the managed ledger has been fenced, we cannot continue using it. We need to close and reopen | ||
close(); | ||
} else { | ||
|
||
// fence topic when failed to write a message to BK | ||
isFenced = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we avoiding fencing ledger when topic actually sees ManagedLedgerFencedException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rdhabalia I add this set here in a previous PR part of a line of PRs to fix problems in message deduplication (#5218). Setting "isFenced = true;" there when the exception is ManagedLedgerFencedException is inappropriate because of this check in close():
There is already logic in the close() method to fence the topic
rerun java8 tests |
rerun integration tests |
* Bug in Message Deduplication that may cause incorrect behavior * add tests * fix error message * fix client backoff * fix tests * cleaning up * Fix handling of BK write failures for message dedup * tests and clean up * refactoring code * fixing bugs * addressing comments * add missing license header * Improve error handling of BK write failures * fixing tests * fixing bugs * cleaning up * addressing comments * fixing tests (cherry picked from commit 60abcaa)
Master Issue: #5218
Motivation
Last PR to fix #5218 and a continuation of PR #5271. When a BK write failures happens, instead of waiting for 10 seconds before creating a new ledger, we should use proper signals to resume writing (create a new ledger) after the error recovery code has completed running to prevent any race conditions.