Skip to content
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

rgw: Fix races in initialization of data sync #47566

Closed
wants to merge 5 commits into from

Conversation

adamemerson
Copy link
Contributor

@adamemerson adamemerson commented Aug 11, 2022

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

src/rgw/rgw_data_sync.cc Outdated Show resolved Hide resolved
src/rgw/rgw_data_sync.cc Show resolved Hide resolved
@adamemerson adamemerson force-pushed the wip-init-raceless branch 2 times, most recently from 4d64655 to c468707 Compare August 12, 2022 02:14
src/rgw/rgw_data_sync.cc Outdated Show resolved Hide resolved
src/rgw/rgw_cr_rados.h Show resolved Hide resolved
src/rgw/rgw_data_sync.cc Show resolved Hide resolved
src/rgw/rgw_data_sync.cc Show resolved Hide resolved
Sticking random #defines everywhere is just atrocious style.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
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 <aemerson@redhat.com>
RGWDataSyncCR manages the lock instead, holding it through StateInit
and StateBuildingFullSyncMaps but releasing it by StateSync.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
If someone else got there first, we won't smash their work.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
The `radosgw-admin data sync init` command does *not* use
`cls_version` and just overwrites.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
@github-actions
Copy link

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

@cbodley
Copy link
Contributor

cbodley commented Oct 6, 2022

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

@cbodley
Copy link
Contributor

cbodley commented Nov 23, 2022

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