Commit Graph

131808 Commits

Author SHA1 Message Date
Adam C. Emerson
c2fd1bda79 rgw: RGWRemoteBucketManager constructor takes num_shards
The logic for getting it was moved to its caller.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:33 -04:00
Adam C. Emerson
c4dc861263 rgw: InitBucketFullSyncStatusCR gets num shards from remote
As specified in rgw_bucket_index_marker_info, unless we're doing the
compatibility check, in which case we look at generation 0.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:33 -04:00
Shilpa Jagannath
df730b5d34 rgw: read shard count using remote bilog info during bucket sync
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
2022-05-27 15:47:33 -04:00
Casey Bodley
24ecdeab1f doc/rgw: document zone features
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:33 -04:00
Casey Bodley
ab964c5e0a rgw: RGWSI_Zone::can_reshard() respects zonegroup 'resharding' feature
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:33 -04:00
Casey Bodley
fe991ba650 radosgw-admin: 'sync status' shows enabled/disabled zonegroup features
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
ab000c96a3 radosgw-admin: zone/zonegroup commands support --enable-feature=x --disable-feature=y
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
2dfa4747f2 rgw: add set of 'features' to zone and zonegroup
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
b2c6a30c21 json: encoding for flat_set accepts all template params
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Yuval Lifshitz
b44b71ab08 rgw/multisite: don't delete per shard status on init
and pass correct generation and num shards when deleting
per shard status objects when disabling during incremental sync

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
2022-05-27 15:47:32 -04:00
Yuval Lifshitz
d7c94b0112 rgw/multisite: support enable right after disable
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
2022-05-27 15:47:32 -04:00
Yuval Lifshitz
072220eecd rgw/multisite: remove the retry mechanism
when writign the sync status object

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
2022-05-27 15:47:32 -04:00
Yuval Lifshitz
9ebebc3c66 rgw/multisite: allow bucket sync disable/enable
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
2022-05-27 15:47:32 -04:00
Yuval Lifshitz
bfc1b7ec68 rgw/multisite: track shard sync status objects per generation
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
dc8ae698ad rgw: remove destination shard id from rgw_bucket_sync_pair_info
the sync_pair is used as input to RGWBucketPipeSyncStatusManager::status_oid()
to generate the per-shard sync status object names

this sync status tracks incremental bucket sync, which reads changes
from a source bucket's bilog shard, and copies objects from the remote
source bucket to the local destination bucket

this doesn't require sync to know anything about the destination bucket
shards, so rgw_bucket_sync_pair_info and status_oid() now only track the
the destination's rgw_bucket instead of rgw_bucket_shard

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
9ad677b965 rgw: Trim old generations in BucketTrimInstanceCR
Only one generation per call.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
899596f650 rgw: Add RGWRadosRemoveOidCR
A more generally applicable way of removing objects in coroutines.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
da525470fb rgw: Add RGWAsyncPutBucketInstanceInfoCR
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
485fa04fe8 rgw: Trim bilog with generation
From the REST interface and radosgw-admin. Assume Generation 0 if none
provided and error if it doesn't exist.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
55af2e10c7 rgw: Bilog trim takes markers as string view
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
826fe361fb common: get_str_vec takes std::string_view
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
cb033837a1 rgw: BucketInstanceTrimCR knows about generations
Fetch the current generation from remote peers and trim the minimum
marker on the minimum generation.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
817ddf8ea6 rgw: Add cast from bucket_index_log_layout
To bucket_index_layout_generation

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
2362982b4e rgw: add sync_info to BILog_Status output
Needed so we can get the incremental generation.

Guard this behind a version check and return the original output if
less than 2.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Shilpa Jagannath
09e94be95f rgw: fix incremental sync by using the right generation for bilog listing
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
2022-05-27 15:47:32 -04:00
Shilpa Jagannath
0e2217a592 rgw: on bucket reshard, write datalog entries for each shard of the previous generation
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
8521fb2be0 qa/rgw: temporarily disable multisite reshard tests
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
da2655c5ef test/rgw: add multisite test for full sync after reshard
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
8166a4c7a0 test/rgw: add simple multisite reshard test
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
c62bfa9f4f radosgw-admin: 'bucket sync checkpoint' waits for generation to catch up
poll on rgw_read_bucket_full_sync_status() until
full_status.incremental_gen catches up to the latest_gen we got from
rgw_read_remote_bilog_info()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
820c94b0fc rgw: get_bucket_instance_ids() uses num_shards from layout
knock out a TODO that was causing this assertion failure in
RGWRados::get_bucket_stats() after a reshard:

  ceph_assert(headers.size() == bucket_instance_ids.size());

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
8f264278fc rgw: rgw_read_remote_bilog_info() returns rgw_bucket_index_marker_info
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Shilpa Jagannath
5b8d2b881d rgw: adding generation number to async notification
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
cf160da178 rgw: add custom json encode/decode for the v1 notify API
this adds wrapper structs rgw_data_notify_v1_encoder and
rgw_data_notify_v1_decoder that can encode/decode the v1 json format
directly on the v2 data structure

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
1c2e290fbc test/rgw: fix python error on test failure
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
3d9015c123 rgw: fix handling of bucket layout in metadata sync
clear the bucket layout we get from the metadata master, and overwrite it
with our zone's defaults

without clearing the layout, init_default_bucket_layout() was adding another
log layout in addition to the one from the master. this caused the bilog
list API to provide a 'next_log' when only gen=0 exists

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Yuval Lifshitz
950251f923 rgw/multisite: fix bucket shard state init function
* make sure src/dest shard ids are the same in sync pair
* copy sync pair by value in coroutine loop

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
2022-05-27 15:47:32 -04:00
Shilpa Jagannath
e73eac1bbd rgw: update bucket sync status after bucket shards finishes current gen
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
94fdadd356 rgw: reshard preserves old index in multisite
if the old index is still referenced by an InIndex log layout, we can't
call clean_index() to remove the index objects yet. log trimming will do
that later, once the bilogs are no longer needed

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
190c260b3e rgw: BILog_List handles requests for generation=0
previous logic treated requests for generation=0 as the latest gen

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
d7750eeb13 rgw: zero-initialize rgw_bucket_sync_status::incremental_gen
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
3f86289f1b rgw: handle older/newer generations after reading bucket sync status
wait until we've read the bucket sync status and found that we're in
incremental sync before we start using incremental_gen for comparison

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
cdfc44006c rgw: Handle entries of the wrong generation
Drop entries from past generations.

Send entries of future generations to the error repo for retry.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
fda49c4772 rgw: rgw_data_change can decode v1 format if gen was 0
but if gen>0, require decoders to understand the v2 format. this way,
old clients can't decode entries with gen>0, so they won't be able to
serve them to other zones

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
56c7f37b55 rgw: rename rgw_data_change::gen_id
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
6f83f07d7f rgw: add gen parameter to RGWDataChangesLog::add_entry
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
2c94978c29 rgw: Add gen_id to rgw_data_change
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Adam C. Emerson
a0d1290503 rgw: vector<rgw_data_change_log_entry> not list
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
ccd68c668d rgw: add json encoding of bucket layout types
adds a "layout" section to RGWBucketInfo

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00
Casey Bodley
9fd4db2bf7 json: add encode_json() overload for string_view
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-05-27 15:47:32 -04:00