-
Notifications
You must be signed in to change notification settings - Fork 968
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: Protect BumpUp()
from running in parallel to serialization
#4307
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -468,6 +468,7 @@ OpResult<DbSlice::PrimeItAndExp> DbSlice::FindInternal(const Context& cntx, std: | |
db.prime.CVCUponBump(change_cb_.back().first, res.it, bump_cb); | ||
} | ||
|
||
block_counter_.Wait(); // We must not change the bucket's internal order during serialization | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have to moved it to line 463 such that the whole block (including the capture version change) is atomic but it should be fine this way as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am merging this because I want the tests to run with this flag over the weekend |
||
auto bump_it = db.prime.BumpUp(res.it, PrimeBumpPolicy{&fetched_items_}); | ||
if (bump_it != res.it) { // the item was bumped | ||
res.it = bump_it; | ||
|
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.
not related to this PR but
block_counter_
is not a good name because it does not say much about the semantics of the variable.