Repository navigation
rgw: address crash and race in RGWIndexCompletionManager - #45882
Merged
Merged
Conversation
ivancich
force-pushed
the
wip-index-completion-mgr-crash
branch
2 times, most recently
from
April 12, 2022 22:31
c75b06b to
c650ddf
Compare
dang
approved these changes
Apr 14, 2022
mattbenjamin
self-requested a review
April 14, 2022 14:27
Contributor
|
@ivancich which downstream branches do we need this fix on? |
adamemerson
approved these changes
Apr 14, 2022
mattbenjamin
approved these changes
Apr 26, 2022
mattbenjamin
left a comment
Contributor
There was a problem hiding this comment.
could you hack the int decl?
Contributor
There was a problem hiding this comment.
would prefer uint32_t or at worst, "unsigned int"
ivancich
force-pushed
the
wip-index-completion-mgr-crash
branch
from
April 26, 2022 21:49
c650ddf to
4c8ec26
Compare
An atomic int was used in a modulo operator to distribute contention among a set of locks and to track completions. Because it was an int, enough increments would cause it to go negative (due to twos-complement encoding and overflow) thereby causing a crash. Additionally, even though it was atomic, the read and increment were separate operations, leading to a race. This commit addresses both of these issues. Signed-off-by: J. Eric Ivancich <[email protected]>
ivancich
force-pushed
the
wip-index-completion-mgr-crash
branch
from
April 26, 2022 22:37
4c8ec26 to
41f4e83
Compare
Member
Author
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.
An atomic int was used in a modulo operator to distribute contention
among a set of locks and to track completions. Because it was an int,
enough increments would cause it to go negative (due to
twos-complement encoding and overflow) thereby causing a
crash. Additionally, even though it was atomic, the read and increment
were separate operations, leading to a race.
This commit addresses both of these issues.
Signed-off-by: J. Eric Ivancich [email protected]
Fixes: https://tracker.ceph.com/issues/55131
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows