Skip to content

rgw multisite: prevent reshard from creating too many log generations#43334

Closed
cbodley wants to merge 1 commit intoceph:wip-rgw-multisite-reshardfrom
cbodley:wip-rgw-multisite-reshard-can-reshard
Closed

rgw multisite: prevent reshard from creating too many log generations#43334
cbodley wants to merge 1 commit intoceph:wip-rgw-multisite-reshardfrom
cbodley:wip-rgw-multisite-reshard-can-reshard

Conversation

@cbodley
Copy link
Contributor

@cbodley cbodley commented Sep 28, 2021

in multisite, each reshard creates a new log generation, and RGWBucketInfo has to track all old log generations until other zones finish syncing them. prevent resharding on a bucket once the number of log generations reaches 4. the bucket will become eligible for reshard again once bilog trimming removes a log generation

this adds two separate checks; one in rgw_admin.cc specifically for radosgw-admin bucket reshard (which supports overriding with --yes-i-really-mean-it), and another in RGWReshard::process_entry() which covers buckets added by dynamic resharding or radosgw-admin reshard add

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

@cbodley
Copy link
Contributor Author

cbodley commented Sep 28, 2021

smoke tested with two mstart.sh clusters, using bilog autotrim to trigger trim of a generation. all commands run on the primary zone:

cbodley@localhost ~/ceph/build $ s3cmd -c ../work/c1.s3cfg mb s3://bucket
Bucket 's3://bucket/' created

~/ceph/build $ bin/radosgw-admin -c run/c1/ceph.conf bucket reshard --bucket bucket --num-shards 12
tenant:
bucket name: bucket
total entries: 0
2021-09-28T10:47:53.906-0400 7fe334931b00  1 execute INFO: reshard of bucket "bucket" completed successfully

cbodley@localhost ~/ceph/build $ bin/radosgw-admin -c run/c1/ceph.conf bucket reshard --bucket bucket --num-shards 13
tenant:
bucket name: bucket
total entries: 0
2021-09-28T10:47:56.355-0400 7fb5d57cfb00  1 execute INFO: reshard of bucket "bucket" completed successfully

cbodley@localhost ~/ceph/build $ bin/radosgw-admin -c run/c1/ceph.conf bucket reshard --bucket bucket --num-shards 14
tenant:
bucket name: bucket
total entries: 0
2021-09-28T10:47:58.348-0400 7f988f668b00  1 execute INFO: reshard of bucket "bucket" completed successfully

cbodley@localhost ~/ceph/build $ bin/radosgw-admin -c run/c1/ceph.conf bucket reshard --bucket bucket --num-shards 15
bucket 'bucket' already has too many log generations (4) from previous reshards that peer zones haven't finished syncing. resharding is not recommended until the old generations sync, but you can force a reshard with --yes-i-really-mean-it

cbodley@localhost ~/ceph/build $ bin/radosgw-admin -c run/c1/ceph.conf bilog autotrim

cbodley@localhost ~/ceph/build $ bin/radosgw-admin -c run/c1/ceph.conf bucket reshard --bucket bucket --num-shards 15
tenant:
bucket name: bucket
total entries: 1
2021-09-28T11:45:25.180-0400 7f4faf425b00  1 execute INFO: reshard of bucket "bucket" completed successfully

@cbodley cbodley force-pushed the wip-rgw-multisite-reshard-can-reshard branch from 93d8efd to 2729d7e Compare September 28, 2021 16:22
std::cerr << "bucket '" << bucket->get_name() << "' already has too many "
"log generations (" << bucket->get_info().layout.logs.size() << ") "
"from previous reshards that peer zones haven't finished syncing. "
"resharding is not recommended until the old generations sync, but "
Copy link
Member

Choose a reason for hiding this comment

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

Capitalize "r" in "resharding" since it's a new sentence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

caps?? i'm not sure my keyboard has those :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, thanks for the review!

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley cbodley force-pushed the wip-rgw-multisite-reshard-can-reshard branch from 2729d7e to 366e4da Compare September 28, 2021 16:59
@cbodley
Copy link
Contributor Author

cbodley commented Oct 12, 2021

merged into #39002

@cbodley cbodley closed this Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants