Skip to content

rgw: Fix races in initialization of data sync - #47566

Closed
adamemerson wants to merge 5 commits into
ceph:mainfrom
adamemerson:wip-init-raceless
Closed

adamemerson wants to merge 5 commits into
ceph:mainfrom
adamemerson:wip-init-raceless

Conversation

@adamemerson

@adamemerson adamemerson commented Aug 11, 2022 •

Copy link
Copy Markdown
Contributor

In a simple, easy process:

  • Pull top-level data sync status lock out of RGWInitDataSyncStatusCoroutine. In RGWDataSyncCR hold the lock through StateInit and StateBuildingFullSyncMaps, but release once we reach StateSync.
  • Re-read sync status after acquiring lock in RGWDataSyncCR.
  • Use cls_version for reads/writes to to global sync status to avoid overwrites. (radosgw-admin data sync init should overwrite, however.)
  • BONUS: Use cls_version for reads/writes to per-shard sync status under DataSyncShardCR. (Should probably wait until rgw: Break Full and Incremental sync out into their own classes #47422 merges.)

Contribution Guidelines

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

Comment thread src/rgw/rgw_data_sync.cc Resolved
Comment thread src/rgw/rgw_data_sync.cc Resolved
@adamemerson
adamemerson force-pushed the wip-init-raceless branch 2 times, most recently from 4d64655 to c468707 Compare August 12, 2022 02:14
Comment thread src/rgw/rgw_data_sync.cc Resolved
@adamemerson
adamemerson marked this pull request as ready for review August 16, 2022 18:43
@smanjara
smanjara self-requested a review August 16, 2022 20:44
Comment thread src/rgw/rgw_cr_rados.h Resolved
Comment thread src/rgw/rgw_data_sync.cc Resolved
Comment thread src/rgw/rgw_data_sync.cc Resolved
Sticking random #defines everywhere is just atrocious style.

Signed-off-by: Adam C. Emerson <[email protected]>
Since we were taking them by reference and copying before, this is
strictly better. Callers that give us an RValue can skip the copy.

Signed-off-by: Adam C. Emerson <[email protected]>
RGWDataSyncCR manages the lock instead, holding it through StateInit
and StateBuildingFullSyncMaps but releasing it by StateSync.

Signed-off-by: Adam C. Emerson <[email protected]>
If someone else got there first, we won't smash their work.

Signed-off-by: Adam C. Emerson <[email protected]>
The `radosgw-admin data sync init` command does *not* use
`cls_version` and just overwrites.

Signed-off-by: Adam C. Emerson <[email protected]>
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Comment thread src/rgw/rgw_data_sync.cc Resolved
@cbodley

cbodley commented Oct 6, 2022

Copy link
Copy Markdown
Contributor

anything more to do here? i'd like to get this and #47682 tested/merged

@cbodley

cbodley commented Nov 23, 2022

Copy link
Copy Markdown
Contributor

included in #48898

@cbodley cbodley closed this Nov 23, 2022
@adamemerson
adamemerson deleted the wip-init-raceless branch January 10, 2023 16:42
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