Skip to content

rgw multisite: remove sharding from bucket full sync#37573

Closed
cbodley wants to merge 27 commits intoceph:masterfrom
cbodley:wip-rgw-bucket-full-sync
Closed

rgw multisite: remove sharding from bucket full sync#37573
cbodley wants to merge 27 commits intoceph:masterfrom
cbodley:wip-rgw-bucket-full-sync

Conversation

@cbodley
Copy link
Contributor

@cbodley cbodley commented Oct 6, 2020

currently, bucket full sync runs once for each bucket index shard, by listing all objects in that shard and fetching them. this coupling with the index shards is problematic for resharding, because any full syncs in progress would be unable to continue their listing after a reshard

by moving full sync from per-bucket-shard to per-bucket, we can use a normal ordered bucket listing, which is stable across reshards. to track this full sync status, we add a new per-bucket sync status object, along with some backward-compatibility logic to skip a full sync if all of its shard status objects exist and show incremental sync

when starting full sync, a cls lock is acquired on this full sync status object to prevent other data sync shards from duplicating the work. the shards that fail to get this lock will retry until the full sync finishes

in the future, this bucket sync status object will be used to coordinate the per-shard incremental sync across reshard events

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

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 api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@cbodley cbodley added the rgw label Oct 6, 2020
@cbodley cbodley requested review from smanjara and yehudasa October 6, 2020 21:41
@cbodley cbodley force-pushed the wip-rgw-bucket-full-sync branch 3 times, most recently from 0a5b9e5 to 8092929 Compare October 6, 2020 21:59
@cbodley
Copy link
Contributor Author

cbodley commented Oct 9, 2020

https://pulpito.ceph.com/cbodley-2020-10-08_17:50:30-rgw-wip-cbodley-testing-distro-basic-smithi/

i seem to have broken the 'bucket sync disable' tests for pubsub again

@cbodley cbodley force-pushed the wip-rgw-bucket-full-sync branch 2 times, most recently from 2a1183d to 5963f09 Compare October 13, 2020 17:18
@cbodley
Copy link
Contributor Author

cbodley commented Oct 13, 2020

i seem to have broken the 'bucket sync disable' tests for pubsub again

addressed by using exclusive create/cls_version in InitBucketShardStatusCR to avoid overwriting the incremental marker in shard status. we have to save that marker while sync is disabled for pubsub zones, because they can't restart with a full sync; and if they restart incremental sync, they'll sync back up to the SYNCSTOP entry and get stuck in a loop

@yehudasa
Copy link
Member

Should we even continue supporting bucket sync disable? The assumption that a bucket syncs symmetrically doesn't align with bucket granularity sync. Maybe the way to do it is through creating a sync policy that forbids that pipe?

@cbodley
Copy link
Contributor Author

cbodley commented Oct 13, 2020

@yehudasa remember the sync policy stuff is still experimental, and has to be manually enabled in the zonegroup configuration once all zones are upgraded to octopus+. once that's set up, we'll either need some automated conversion logic for disabled buckets, or documentation on how to set up the equivalent policy. until then, i think we're stuck supporting bucket sync disable

@adamemerson adamemerson self-assigned this Nov 11, 2020
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
allows other code to spawn this coroutine without having the class
definition

Signed-off-by: Casey Bodley <cbodley@redhat.com>
RGWShardCollectCR was hard-coded to ignore ENOENT errors and print a
'failed to fetch log status' error message. this moves that logic into a
handle_result() virtual function. it also exposes the member variables
'status' and 'max_concurrent' as protected, so they can be consulted or
modified by overrides of handle_result() and spawn_next()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
a coroutine to initialize a bucket for full sync using a new bucket-wide
sync status object

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
full sync happens as the bucket level, so the shards will always start
in StateIncrementalSync

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
renamed ListBucketShardCR to ListRemoteBucketCR and removed the shard-id
parameter

renamed BucketFullSyncShardMarkerTrack to BucketFullSyncMarkerTrack,
which now updates the bucket-level rgw_bucket_sync_status

renamed BucketShardFullSyncCR to BucketFullSyncCR

BucketSyncCR now takes a bucket-wide lease during full sync

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley cbodley force-pushed the wip-rgw-bucket-full-sync branch from 5963f09 to c8f1c86 Compare November 11, 2020 21:56
@cbodley
Copy link
Contributor Author

cbodley commented Nov 12, 2020

pushed an update which seems to be passing multisite tests, except for those with @attr('bucket_sync_disable') which we'll revisit later

Signed-off-by: Casey Bodley <cbodley@redhat.com>
if metadata sync hasn't finished, the 'bucket checkpoint' commands may
not find its bucket info

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
the ability to filter tests by attribute is provided by the
nose.plugins.attrib plugin, which wasn't being loaded by default

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley cbodley force-pushed the wip-rgw-bucket-full-sync branch from c8f1c86 to 6de4df0 Compare November 16, 2020 18:25
this backoff is triggered often by the per-bucket lease for full sync,
and causes tests to fail with checkpoint timeouts

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley cbodley force-pushed the wip-rgw-bucket-full-sync branch from eaa81b2 to 07834ac Compare November 19, 2020 14:08
@github-actions github-actions bot added the tests label Nov 19, 2020
@cbodley cbodley removed the tests label Nov 19, 2020
@smanjara
Copy link
Contributor

Do we still need 'rgw_bucket_shard_full_sync_marker' in rgw_bucket_shard_sync_info object which is now only tracking incremental sync?

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@github-actions github-actions bot added the tests label Nov 20, 2020
@cbodley
Copy link
Contributor Author

cbodley commented Nov 24, 2020

i pushed this to a feature branch at https://github.com/ceph/ceph/commits/wip-rgw-multisite-reshard so we can continue development there (and target PRs at it) without merging to master

@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 Author

cbodley commented Feb 8, 2021

this is in #39002

@cbodley cbodley closed this Feb 8, 2021
@cbodley cbodley deleted the wip-rgw-bucket-full-sync branch February 8, 2021 16:57
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