Repository navigation
Add fencing to recovery reads to avoid data loss issue - #2616
Conversation
79159cf to
519beb1
Compare
|
@Vanlightly PR validation failed. PTAL Thank you very much for sharing your findings and also provide a fix |
519beb1 to
2beaf5f
Compare
dlg99
left a comment
There was a problem hiding this comment.
@Vanlightly it is an awesome catch and the fix lgtm.
One note about the test: often reliance on Thread.sleep() leads to test flakiness.
Can I ask you to try to remove these and replace with wait for completion of specific events?
|
Another note: NoSuchLedger/NoSuchEntry have special handling in PendingReadLacOp/RoundRobinDistributionSchedule, see #2612 |
|
Yes of course. I'll take a look at both suggestions. |
Also seeded the ledger such that the LAC of the bookies is 0 rather than -1. It doesn't make a huge difference but covers the more likely scenario of a ledger with more than one acknowledged entry.
d8b6f25 to
c47add3
Compare
|
@dlg99 I've replaced the Thread.sleep with CompletableFutures to ensure the right sequence is followed in a non-flaky way. Regarding the issue #2612, I've left a comment there. Basically the protocol is not designed to handle arbitrary failures of that kind and data loss can result. In terms of this particular issue, which is not an arbitrary failure scenario, I think the current test is probably enough. |
|
@Vanlightly Thank you! The changes lgtm. |
Descriptions of the changes in this PR: ### Motivation Adding the fencing flag to recovery reads avoids a data loss scenario as described in [issue 2614](#2614) ### Changes Added the fencing flag to recovery reads. Refactored some mocking unit test code to introduce fencing and allow two writers to share the same bookie state. Added a new unit to verify the fix. You can recreate the initial problem by removing the fencing flag from recovery reads and running the new unit test. Master Issue: #2614 Reviewers: Enrico Olivelli <[email protected]>, Andrey Yegorov <[email protected]> This closes #2616 from Vanlightly/fix-fencing (cherry picked from commit 017307b) Signed-off-by: Enrico Olivelli <[email protected]>
|
pushed to master branch and to branch-4.12. thank you very much @Vanlightly I believe you are now unblocked in sending the next PR |
Descriptions of the changes in this PR:
Motivation
Adding the fencing flag to recovery reads avoids a data loss scenario as described in issue 2614
Changes
Added the fencing flag to recovery reads. Refactored some mocking unit test code to introduce fencing and allow two writers to share the same bookie state. Added a new unit to verify the fix. You can recreate the initial problem by removing the fencing flag from recovery reads and running the new unit test.
Master Issue: #2614