Fix WriteSet use-after-recycle in sequence reads#4788
Open
void-ptr974 wants to merge 1 commit intoapache:masterfrom
Open
Fix WriteSet use-after-recycle in sequence reads#4788void-ptr974 wants to merge 1 commit intoapache:masterfrom
void-ptr974 wants to merge 1 commit intoapache:masterfrom
Conversation
Sequence read completion recycled the WriteSet before registering slow bookies. When a speculative read completed the entry, the subclass could still access the recycled WriteSet. Late error callbacks could also enter reattempt logic and call indexOf() after the request had already completed. Snapshot slow bookie addresses before delegating to the shared complete path, and ignore late errors after sequence read requests have completed. Apply the same guard to ReadLAC sequence reads, where orderedEnsemble is also recycled on completion. Add regression coverage for normal sequence reads and ReadLAC covering both completion and late-error paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4680.
Sequence read completion recycled
WriteSetbeforeSequenceReadRequestfinished using it to register slow bookies. In speculative read scenarios, a faster replica can complete the entrywhile an earlier replica is still outstanding, and the completion path could access the recycled
WriteSet.Late error callbacks could also enter retry/error handling after the entry had already completed, which may access recycled
writeSet/orderedEnsemble.Changes
complete()path that recyclesWriteSet.ReadLastConfirmedAndEntryOpsequence reads.Tests
mvn -pl bookkeeper-server -Dtest=TestSequenceReadWriteSetRecycle test