Skip to content

rgw: address crash and race in RGWIndexCompletionManager - #45882

Merged
ivancich merged 1 commit into
ceph:masterfrom
ivancich:wip-index-completion-mgr-crash
Apr 30, 2022
Merged

ivancich merged 1 commit into
ceph:masterfrom
ivancich:wip-index-completion-mgr-crash

Conversation

@ivancich

@ivancich ivancich commented Apr 12, 2022 •

Copy link
Copy Markdown
Member

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

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@ivancich
ivancich force-pushed the wip-index-completion-mgr-crash branch 2 times, most recently from c75b06b to c650ddf Compare April 12, 2022 22:31
@mattbenjamin
mattbenjamin self-requested a review April 14, 2022 14:27
@mattbenjamin

Copy link
Copy Markdown
Contributor

@ivancich which downstream branches do we need this fix on?

@adamemerson adamemerson removed their assignment Apr 14, 2022

@mattbenjamin mattbenjamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you hack the int decl?

Comment thread src/rgw/rgw_rados.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer uint32_t or at worst, "unsigned int"

Comment thread src/rgw/rgw_rados.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment thread src/rgw/rgw_rados.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

@ivancich
ivancich force-pushed the wip-index-completion-mgr-crash branch from c650ddf to 4c8ec26 Compare April 26, 2022 21:49
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
ivancich force-pushed the wip-index-completion-mgr-crash branch from 4c8ec26 to 41f4e83 Compare April 26, 2022 22:37
@ivancich ivancich changed the title rgw: address crash and race in index completion mgr rgw: address crash and race in RGWIndexCompletionManager Apr 26, 2022
@ivancich ivancich added the wip-eric-testing-1 for ivancich testing label Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants