]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
3 years agorgw: Disentangle RGWBucketPipeSyncStatusManager::run
Adam C. Emerson [Thu, 14 Apr 2022 13:42:54 +0000 (09:42 -0400)]
rgw: Disentangle RGWBucketPipeSyncStatusManager::run

Again, from RGWRemoteBucketManager.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Disentangle read_sync_status from RemoteBucketManager
Adam C. Emerson [Thu, 14 Apr 2022 13:35:40 +0000 (09:35 -0400)]
rgw: Disentangle read_sync_status from RemoteBucketManager

Also fix the problem where we read the status from all peers into the
same map at once.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Disentangle init_sync_status from RemoteBucketManager
Adam C. Emerson [Wed, 13 Apr 2022 02:10:31 +0000 (22:10 -0400)]
rgw: Disentangle init_sync_status from RemoteBucketManager

RGWRemoteBucketManager's current design isn't really compatible with
what we need for bucket sync run to work as the number of shards
changes from run to run.

We can make a smaller 'hold information common to all three
operations' class and simplify things a bit.

We also need to fetch `rgw_bucket_index_marker_info` and supply it to
`InitBucketFullSyncStatusCR` to ensure we have the correct generation
and shard count.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Get rid of RGWBucketPipeSyncStatusManager::init
Adam C. Emerson [Wed, 13 Apr 2022 01:37:05 +0000 (21:37 -0400)]
rgw: Get rid of RGWBucketPipeSyncStatusManager::init

Use the Named Constructor Idiom instead.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: RGWBucketPipeSyncStatusManager doesn't need a conn
Adam C. Emerson [Tue, 12 Apr 2022 23:44:48 +0000 (19:44 -0400)]
rgw: RGWBucketPipeSyncStatusManager doesn't need a conn

`conn` is per-source. last_zone just saved a lookup in a small map.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Get rid of RGWBucketPipeSyncStatusManager::get_sync_status
Adam C. Emerson [Tue, 12 Apr 2022 20:46:46 +0000 (16:46 -0400)]
rgw: Get rid of RGWBucketPipeSyncStatusManager::get_sync_status

Instead of one function that sets a variable and another function that
returns it and nobody else touches it, just return the sync status.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Clean up RGWBucketPipeSyncStatusManager construction
Adam C. Emerson [Tue, 12 Apr 2022 20:26:27 +0000 (16:26 -0400)]
rgw: Clean up RGWBucketPipeSyncStatusManager construction

The coupling between this class and RGWRemoteBucketManager makes no
sense. Clean things up a bit.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Remove unused members of RGWBucketPipeSyncStatusManager
Adam C. Emerson [Tue, 12 Apr 2022 23:53:46 +0000 (19:53 -0400)]
rgw: Remove unused members of RGWBucketPipeSyncStatusManager

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agotest/rgw: add DistinctGen to test_rgw_bucket_sync_cache
Casey Bodley [Mon, 16 May 2022 21:11:13 +0000 (17:11 -0400)]
test/rgw: add DistinctGen to test_rgw_bucket_sync_cache

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agotest/rgw: update test_rgw_bucket_sync_cache with nullopt
Casey Bodley [Mon, 16 May 2022 21:08:15 +0000 (17:08 -0400)]
test/rgw: update test_rgw_bucket_sync_cache with nullopt

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: Disable urgent data notifications
Adam C. Emerson [Sat, 14 May 2022 06:39:56 +0000 (02:39 -0400)]
rgw: Disable urgent data notifications

These interfere with multisite resharding and are thus disabled.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw/multisite: ignore sync init state when doing bilog trimming
Yuval Lifshitz [Fri, 15 Apr 2022 11:45:49 +0000 (14:45 +0300)]
rgw/multisite: ignore sync init state when doing bilog trimming

regardless of the sync state, we take the marker from the
incremental sync object

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agosrc/test: Addition of new bilog trim test
Kalpesh Pandya [Wed, 16 Feb 2022 06:11:51 +0000 (11:41 +0530)]
src/test: Addition of new bilog trim test

This test includes checking radosgw-admin bucket layout command
along with bilog autrotrim on a resharded bucket.

Signed-off-by: Kalpesh Pandya <kapandya@redhat.com>
3 years agorgw/multisite: match sharding logic to generation number
yuval Lifshitz [Tue, 15 Mar 2022 18:42:01 +0000 (20:42 +0200)]
rgw/multisite: match sharding logic to generation number

Signed-off-by: yuval Lifshitz <ylifshit@redhat.com>
3 years agorgw multisite: resharding scales up shard counts 4x faster
Casey Bodley [Fri, 25 Mar 2022 21:14:05 +0000 (17:14 -0400)]
rgw multisite: resharding scales up shard counts 4x faster

in multisite reshard, we need to keep the old index shards around until
other zones finishing syncing from them. we don't want to allow a
bunch of reshards in a row, because we have to duplicate that many
sets of index objects. so we impose a limit of 4 bilog generations (or 3
reshards), and refuse to reshard again until bilog trimming catches up/
trims the oldest generation

under a sustained write workload, a bucket can fill quickly and need
successive reshards. if we have a limit of 3, we should make them count!
so instead of doubling the shard count at each step, multiply by 8
instead when we're in a multisite configuration

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: Redimension bucket sync cache to include optional generation
Adam C. Emerson [Tue, 22 Feb 2022 19:50:33 +0000 (14:50 -0500)]
rgw: Redimension bucket sync cache to include optional generation

The alternative would be to compare generations and throw out older
generation/no generation if we have a (newer) one.

But if we have the potential for older generations and blank
generations coming up on error retry, then we have to keep them
around.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: prevent spurious/lost notifications in the index completion thread
Yuval Lifshitz [Wed, 23 Feb 2022 15:21:10 +0000 (17:21 +0200)]
rgw: prevent spurious/lost notifications in the index completion thread

this was happening when asyn completions happened during reshard.
more information about testing:
https://gist.github.com/yuvalif/d526c0a3a4c5b245b9e951a6c5a10517

we also add more logs to the completion manager.
should allow finding unhandled completions due to reshards.

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agorgw: refrash the generation of the bucket shard when fetching info
Yuval Lifshitz [Thu, 10 Feb 2022 16:12:55 +0000 (18:12 +0200)]
rgw: refrash the generation of the bucket shard when fetching info

when RGWRados::block_while_resharding() fails because reshard is in
progress, in the next iteration we should fetch the bucket shard
generation. for the case that the generation changed in the middle.

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agotest/rgw: test_rgw_reshard.py injects ECANCELED on set_target_layout/commit_target_layout
Casey Bodley [Thu, 10 Feb 2022 19:32:16 +0000 (14:32 -0500)]
test/rgw: test_rgw_reshard.py injects ECANCELED on set_target_layout/commit_target_layout

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoradosgw-admin: add --inject-error-code to customize injected error
Casey Bodley [Thu, 10 Feb 2022 19:31:26 +0000 (14:31 -0500)]
radosgw-admin: add --inject-error-code to customize injected error

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw/reshard: revert_target_layout handles ECANCELED races/retries
Casey Bodley [Thu, 10 Feb 2022 23:32:49 +0000 (18:32 -0500)]
rgw/reshard: revert_target_layout handles ECANCELED races/retries

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw/reshard: init_target_layout handles ECANCELED races/retries
Casey Bodley [Thu, 10 Feb 2022 23:32:29 +0000 (18:32 -0500)]
rgw/reshard: init_target_layout handles ECANCELED races/retries

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw/reshard: commit_reshard handles ECANCELED races/retries
Casey Bodley [Thu, 10 Feb 2022 22:39:45 +0000 (17:39 -0500)]
rgw/reshard: commit_reshard handles ECANCELED races/retries

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: pass non-const ReshardFaultInjector
Casey Bodley [Thu, 10 Feb 2022 22:06:23 +0000 (17:06 -0500)]
rgw: pass non-const ReshardFaultInjector

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: add comparison operators for index layout types
Casey Bodley [Thu, 10 Feb 2022 22:04:05 +0000 (17:04 -0500)]
rgw: add comparison operators for index layout types

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw/reshard: set_resharding_status() doesn't need retry
Casey Bodley [Thu, 10 Feb 2022 22:38:16 +0000 (17:38 -0500)]
rgw/reshard: set_resharding_status() doesn't need retry

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: Retry -ECANCELED in reshard commit and cancel
Adam C. Emerson [Mon, 7 Feb 2022 20:23:57 +0000 (15:23 -0500)]
rgw: Retry -ECANCELED in reshard commit and cancel

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: prevent 'radosgw-admin bucket reshard' if zonegroup reshard is disabled
Casey Bodley [Wed, 9 Feb 2022 21:55:38 +0000 (16:55 -0500)]
rgw: prevent 'radosgw-admin bucket reshard' if zonegroup reshard is disabled

dynamic reshard was gated behind the zonegroup resharding flag with
RGWSI_Zone::can_reshard(), but manual reshard was only calling
RGWBucketReshard::can_reshard()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: add back json for zone/zonegroup features
Casey Bodley [Wed, 9 Feb 2022 20:08:02 +0000 (15:08 -0500)]
rgw: add back json for zone/zonegroup features

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: RGWBucket::sync() no longer duplicates datalog/bilog entries
Casey Bodley [Wed, 19 Jan 2022 01:39:37 +0000 (20:39 -0500)]
rgw: RGWBucket::sync() no longer duplicates datalog/bilog entries

RGWSI_BucketIndex_RADOS::handle_overwrite() is already writing the
datalog/bilog entries related to BUCKET_DATASYNC_DISABLED

RGWBucket::sync() calls handle_overwrite() indirectly from
bucket->put_info() when it writes the bucket instance with this new
BUCKET_DATASYNC_DISABLED flag, so RGWBucket::sync() shouldn't
duplicate those writes here

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: add checks for non-empty layout.logs
Casey Bodley [Tue, 18 Jan 2022 21:48:25 +0000 (16:48 -0500)]
rgw: add checks for non-empty layout.logs

always verify that logs is not empty before calling logs.back() or
logs.front()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: use get_current_index() instead of log_to_index_layout()
Casey Bodley [Tue, 18 Jan 2022 21:43:42 +0000 (16:43 -0500)]
rgw: use get_current_index() instead of log_to_index_layout()

several places were getting the current index layout indirectly
with layout.logs.back() and rgw::log_to_index_layout(). use
get_current_index() instead so we don't rely on layout.logs, which may
be empty for indexless buckets

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoradosgw-admin: add command to dump 'bucket layout'
Casey Bodley [Tue, 8 Feb 2022 19:39:12 +0000 (14:39 -0500)]
radosgw-admin: add command to dump 'bucket layout'

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: Add generation to ChangeStatus
Adam C. Emerson [Tue, 8 Feb 2022 18:11:44 +0000 (13:11 -0500)]
rgw: Add generation to ChangeStatus

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Compare log.gen to log.gen
Adam C. Emerson [Mon, 7 Feb 2022 22:00:25 +0000 (17:00 -0500)]
rgw: Compare log.gen to log.gen

And refuse to remove the only log.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Don't erase bucket attributes on trim
Adam C. Emerson [Wed, 2 Feb 2022 20:53:41 +0000 (15:53 -0500)]
rgw: Don't erase bucket attributes on trim

Writing bucket instance info is surprising, as if you pass a null
pointer for the attributes, it just erases all the attributes.

To avoid disturbing users and other 'system objects', make a special
case that we can pass in explicitly.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw/reshard: resolve inconsistent cache warnings
Yuval Lifshitz [Tue, 1 Feb 2022 09:04:06 +0000 (11:04 +0200)]
rgw/reshard: resolve inconsistent cache warnings

use an API that does not check for cache inconsistency
hence, "WARNING: The bucket info cache is inconsistent" warnings is removed from reshard

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agotest/rgw: test_bucket_reshard verifies that ACLs are preserved
Casey Bodley [Mon, 17 Jan 2022 22:14:54 +0000 (17:14 -0500)]
test/rgw: test_bucket_reshard verifies that ACLs are preserved

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: save bucket instance xattrs when resharding cancelled
J. Eric Ivancich [Fri, 7 Jan 2022 19:43:05 +0000 (14:43 -0500)]
rgw: save bucket instance xattrs when resharding cancelled

There appears to be a long-standing bug in RGW such that when
resharding is cancelled and the bucket instance is updated to reflect
the new resharding status, the xattrs were lost. The xattrs are used
to store metadata such as ACLs and LifeCycle policies.

This commit makes sure that all call paths that lead to a cancelled
reshard provide the xattrs, so they can be included when the bucket
instance info is updated.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
3 years agorgw: resharding causes bucket attributes to be lost
J. Eric Ivancich [Fri, 7 Jan 2022 17:32:48 +0000 (12:32 -0500)]
rgw: resharding causes bucket attributes to be lost

With the new resharding code, some bucket metadata that is stored as
xattrs (e.g., ACLs, life-cycle policies) were not sent with the
updated bucket instance data when resharding completed. As a result,
resharding has a regression where that metadata is lost after a
successful reshard.

This commit restores the variable in the RGWBucketReshard class that
maintains the bucket attributes, so they can be saved when the bucket
instance object is updated.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
3 years agorgw: add indexless bucket logic to "bucket radoslist"
J. Eric Ivancich [Mon, 17 Jan 2022 21:14:16 +0000 (16:14 -0500)]
rgw: add indexless bucket logic to "bucket radoslist"

The "bucket radoslist" sub-command of radosgw-admin is supposed to
list all rados objects tied to one or all directories and thereby
provide a way to determine orphaned rados objects.

But indexless buckets don't provide an index to employ for this
purpose. So warnings or errors should be provided depending on the
circumstances.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
3 years agorgw: update indexless bucket check for bucket stats
J. Eric Ivancich [Mon, 24 Jan 2022 21:10:57 +0000 (16:10 -0500)]
rgw: update indexless bucket check for bucket stats

The code for bucket stats was recently updated to check for an
indexless bucket before proceeding. The interface on RGWBucketInfo was
recently expanded to support these types of checks, so it is now used.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
3 years agorgw: add streamlined ways to handle indexless buckets correctly
J. Eric Ivancich [Mon, 24 Jan 2022 21:08:01 +0000 (16:08 -0500)]
rgw: add streamlined ways to handle indexless buckets correctly

Determining whether a bucket is indexless starting with an
RGWBucketInfo object requires traversing multiple data structures and
"inside knowledge" blurring the line between interface and
implementation. The same applies for retrieving the current index for
non-indexless buckets.

This commit adds to the RGWBucketInfo interface to make this
information readily accessible.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
3 years agorgw/multisite: add type to RGW_OP_SYNC_DATALOG_NOTIFY2
Yuval Lifshitz [Sun, 16 Jan 2022 16:35:23 +0000 (18:35 +0200)]
rgw/multisite: add type to RGW_OP_SYNC_DATALOG_NOTIFY2

without that the following errors are happening during sync:

ERROR: AWS4 completion for operation: 0, NOT IMPLEMENTED
op->ERRORHANDLER: err_no=-2201 new_err_no=-2201

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agorgw: `radosgw-admin bucket stats` on indexless bucket crashes
J. Eric Ivancich [Thu, 23 Dec 2021 21:25:26 +0000 (16:25 -0500)]
rgw: `radosgw-admin bucket stats` on indexless bucket crashes

The new bucket layout code didn't check whether the bucket is
indexless prior to asking for the last entry in the layout log. The
layout log appears to be empty for an indexless bucket, thereby
putting the runtime in an undefined state that later may cause a
failed assertion.

This commit adds two safety checks and returns -EINVAL along with
putting useful information on stderr when either stats are requested
on an indexless bucket or when the layout log is empty.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
3 years agorgw: fix reshard cancelling race condition
Yuval Lifshitz [Wed, 8 Dec 2021 19:35:25 +0000 (21:35 +0200)]
rgw: fix reshard cancelling race condition

this is happening when resharding while objects are uploaded
tests steps are here:
https://gist.github.com/yuvalif/060f66f03511bff881e952287df3087b

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agorgw: preserve 'bucket sync disable' over reshard
Casey Bodley [Wed, 8 Dec 2021 15:11:22 +0000 (10:11 -0500)]
rgw: preserve 'bucket sync disable' over reshard

if bucket sync is disabled, apply that flag to new index objects on
bucket reshard

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw/multisite: handle shard_progress correctly in RunBucketSources
Casey Bodley [Mon, 22 Nov 2021 19:23:01 +0000 (14:23 -0500)]
rgw/multisite: handle shard_progress correctly in RunBucketSources

we run bucket sync on each of the sync pipes, so size the vector
accordingly

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoRevert "rgw: cr: add prealloc_stack()"
Casey Bodley [Mon, 22 Nov 2021 18:51:10 +0000 (13:51 -0500)]
Revert "rgw: cr: add prealloc_stack()"

This reverts commit 7970f355497f48ee5a18bf3a0bc034226c6d225c.

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoRevert "rgw: bucket sync: track progress by stack id"
Casey Bodley [Mon, 22 Nov 2021 18:50:07 +0000 (13:50 -0500)]
Revert "rgw: bucket sync: track progress by stack id"

This reverts commit c0baf3eb34c6c1de7e4de2e35cb62e219c174b0b.

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Conflicts:
src/rgw/rgw_data_sync.cc no longer loops over num_shards

3 years agorgw/multisite: RunBucketSourcesSync no longer takes optional target
Casey Bodley [Mon, 22 Nov 2021 18:05:40 +0000 (13:05 -0500)]
rgw/multisite: RunBucketSourcesSync no longer takes optional target

RGWDataSyncSingleEntryCR is the only caller of RGWRunBucketSourcesSyncCR

it always provides a source_bs, and never provides a target_bs. so remove
all the complexity related to target_bs, and the idea that we'd need to
sync several source bucket shards related to the target bucket

we now just have the single loop over the target buckets that use the
given bucket as a source

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoradosgw-admin: allow reshard commands in multisite on secondary
Casey Bodley [Fri, 15 Oct 2021 14:57:55 +0000 (10:57 -0400)]
radosgw-admin: allow reshard commands in multisite on secondary

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: fix for uninitialized oldest_gen/latest_gen
Casey Bodley [Mon, 18 Oct 2021 18:15:33 +0000 (14:15 -0400)]
rgw: fix for uninitialized oldest_gen/latest_gen

when data sync queries RGWOp_BILog_Info from an un-upgraded gateway, it
doesn't include the oldest_gen/latest_gen fields. so initialize these
variables to 0 by default

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: enable RGWReshard thread on any zone that supports it
Casey Bodley [Tue, 12 Oct 2021 16:45:29 +0000 (12:45 -0400)]
rgw: enable RGWReshard thread on any zone that supports it

enable the background dynamic resharding thread based on
RGWSI_Zone::can_reshard(), which takes the zonegroup features into
account

Fixes: https://tracker.ceph.com/issues/52877
Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: prevent reshard from creating too many log generations
Casey Bodley [Tue, 28 Sep 2021 14:45:27 +0000 (10:45 -0400)]
rgw: prevent reshard from creating too many log generations

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: remove per-shard sync status object after incremental sync finishes
Shilpa Jagannath [Fri, 23 Jul 2021 06:58:24 +0000 (12:28 +0530)]
rgw: remove per-shard sync status object after incremental sync finishes

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoradosgw-admin: bucket sync status guards against shard count mismatch
Casey Bodley [Fri, 20 Aug 2021 14:39:34 +0000 (10:39 -0400)]
radosgw-admin: bucket sync status guards against shard count mismatch

if the remote gives us more shards than we expect, just count those
shards as 'behind' and avoid out-of-bounds access of shard_status

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoradosgw-admin: bucket sync status handles missing full status
Casey Bodley [Thu, 19 Aug 2021 21:21:37 +0000 (17:21 -0400)]
radosgw-admin: bucket sync status handles missing full status

if the full sync status object is missing, it's possible that we just
haven't started syncing it again after upgrading from just the per-shard
status objects

in this case, as long as we have a log generation 0, assume that we just
haven't initialized the full status object and try to read the gen=0
per-shard incremental status for comparison

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: rgw_read_bucket_inc_sync_status doesn't need bucket info
Casey Bodley [Thu, 19 Aug 2021 20:12:21 +0000 (16:12 -0400)]
rgw: rgw_read_bucket_inc_sync_status doesn't need bucket info

all we need to construct the per-shard bucket sync status object names
are the bucket names themselves, which we already have from
rgw_sync_bucket_pipe

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: resize status vector before reading inc_sync_status
Casey Bodley [Thu, 19 Aug 2021 20:30:49 +0000 (16:30 -0400)]
rgw: resize status vector before reading inc_sync_status

rgw_read_bucket_inc_sync_status() uses the size of this vector as the
'num_shards', so we need to resize it appropriately beforehand

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: RGWOp_BILog_Status reads full status unconditionally
Casey Bodley [Thu, 19 Aug 2021 20:21:55 +0000 (16:21 -0400)]
rgw: RGWOp_BILog_Status reads full status unconditionally

the calls to rgw_read_bucket_inc_sync_status() depend on
sync_status.incremental_gen, which we need to read via
rgw_read_bucket_full_sync_status() regardless of whether
we're returning it to the client (version > 1)

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: RGWCollectBucketSyncStatusCR doesn't need the shard count
Adam C. Emerson [Fri, 10 Sep 2021 16:28:28 +0000 (12:28 -0400)]
rgw: RGWCollectBucketSyncStatusCR doesn't need the shard count

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: RunBucketSourceSync uses num_shards from remote bilog info
Adam C. Emerson [Fri, 10 Sep 2021 16:06:53 +0000 (12:06 -0400)]
rgw: RunBucketSourceSync uses num_shards from remote bilog info

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: RGWListBucketIndexesCR only needs zero shard
Adam C. Emerson [Fri, 10 Sep 2021 15:38:05 +0000 (11:38 -0400)]
rgw: RGWListBucketIndexesCR only needs zero shard

We only need to check one shard, and everything has shard zero.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: sync checkpoint gets num_shards from remote bilog info
Adam C. Emerson [Fri, 10 Sep 2021 15:00:07 +0000 (11:00 -0400)]
rgw: sync checkpoint gets num_shards from remote bilog info

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: RGWRemoteBucketManager constructor takes num_shards
Adam C. Emerson [Thu, 2 Sep 2021 21:58:58 +0000 (17:58 -0400)]
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>
3 years agorgw: InitBucketFullSyncStatusCR gets num shards from remote
Adam C. Emerson [Thu, 2 Sep 2021 21:36:09 +0000 (17:36 -0400)]
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>
3 years agorgw: read shard count using remote bilog info during bucket sync
Shilpa Jagannath [Thu, 10 Jun 2021 16:51:21 +0000 (22:21 +0530)]
rgw: read shard count using remote bilog info during bucket sync

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
3 years agodoc/rgw: document zone features
Casey Bodley [Mon, 8 Mar 2021 17:48:13 +0000 (12:48 -0500)]
doc/rgw: document zone features

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: RGWSI_Zone::can_reshard() respects zonegroup 'resharding' feature
Casey Bodley [Wed, 3 Mar 2021 21:58:33 +0000 (16:58 -0500)]
rgw: RGWSI_Zone::can_reshard() respects zonegroup 'resharding' feature

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoradosgw-admin: 'sync status' shows enabled/disabled zonegroup features
Casey Bodley [Wed, 3 Mar 2021 21:55:23 +0000 (16:55 -0500)]
radosgw-admin: 'sync status' shows enabled/disabled zonegroup features

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoradosgw-admin: zone/zonegroup commands support --enable-feature=x --disable-feature=y
Casey Bodley [Wed, 3 Mar 2021 21:54:58 +0000 (16:54 -0500)]
radosgw-admin: zone/zonegroup commands support --enable-feature=x --disable-feature=y

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: add set of 'features' to zone and zonegroup
Casey Bodley [Wed, 3 Mar 2021 19:13:05 +0000 (14:13 -0500)]
rgw: add set of 'features' to zone and zonegroup

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agojson: encoding for flat_set accepts all template params
Casey Bodley [Wed, 3 Mar 2021 19:05:24 +0000 (14:05 -0500)]
json: encoding for flat_set accepts all template params

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw/multisite: don't delete per shard status on init
Yuval Lifshitz [Wed, 16 Jun 2021 09:32:25 +0000 (12:32 +0300)]
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>
3 years agorgw/multisite: support enable right after disable
Yuval Lifshitz [Mon, 14 Jun 2021 14:03:35 +0000 (17:03 +0300)]
rgw/multisite: support enable right after disable

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agorgw/multisite: remove the retry mechanism
Yuval Lifshitz [Thu, 27 May 2021 15:54:31 +0000 (18:54 +0300)]
rgw/multisite: remove the retry mechanism

when writign the sync status object

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agorgw/multisite: allow bucket sync disable/enable
Yuval Lifshitz [Tue, 18 May 2021 15:59:54 +0000 (18:59 +0300)]
rgw/multisite: allow bucket sync disable/enable

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agorgw/multisite: track shard sync status objects per generation
Yuval Lifshitz [Tue, 25 May 2021 18:11:25 +0000 (21:11 +0300)]
rgw/multisite: track shard sync status objects per generation

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
3 years agorgw: remove destination shard id from rgw_bucket_sync_pair_info
Casey Bodley [Wed, 9 Jun 2021 16:26:54 +0000 (12:26 -0400)]
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>
3 years agorgw: Trim old generations in BucketTrimInstanceCR
Adam C. Emerson [Fri, 14 May 2021 22:59:48 +0000 (18:59 -0400)]
rgw: Trim old generations in BucketTrimInstanceCR

Only one generation per call.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Add RGWRadosRemoveOidCR
Adam C. Emerson [Tue, 18 May 2021 22:34:43 +0000 (18:34 -0400)]
rgw: Add RGWRadosRemoveOidCR

A more generally applicable way of removing objects in coroutines.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Add RGWAsyncPutBucketInstanceInfoCR
Adam C. Emerson [Tue, 18 May 2021 21:56:27 +0000 (17:56 -0400)]
rgw: Add RGWAsyncPutBucketInstanceInfoCR

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: Trim bilog with generation
Adam C. Emerson [Mon, 26 Apr 2021 22:45:09 +0000 (18:45 -0400)]
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>
3 years agorgw: Bilog trim takes markers as string view
Adam C. Emerson [Tue, 27 Apr 2021 23:31:57 +0000 (19:31 -0400)]
rgw: Bilog trim takes markers as string view

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agocommon: get_str_vec takes std::string_view
Adam C. Emerson [Tue, 27 Apr 2021 23:31:15 +0000 (19:31 -0400)]
common: get_str_vec takes std::string_view

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: BucketInstanceTrimCR knows about generations
Adam C. Emerson [Fri, 14 May 2021 19:44:01 +0000 (15:44 -0400)]
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>
3 years agorgw: Add cast from bucket_index_log_layout
Adam C. Emerson [Fri, 14 May 2021 19:26:42 +0000 (15:26 -0400)]
rgw: Add cast from bucket_index_log_layout

To bucket_index_layout_generation

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3 years agorgw: add sync_info to BILog_Status output
Adam C. Emerson [Thu, 13 May 2021 21:11:52 +0000 (17:11 -0400)]
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>
3 years agorgw: fix incremental sync by using the right generation for bilog listing
Shilpa Jagannath [Wed, 2 Jun 2021 17:57:06 +0000 (23:27 +0530)]
rgw: fix incremental sync by using the right generation for bilog listing

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
3 years agorgw: on bucket reshard, write datalog entries for each shard of the previous generation
Shilpa Jagannath [Fri, 21 May 2021 06:47:49 +0000 (12:17 +0530)]
rgw: on bucket reshard, write datalog entries for each shard of the previous generation

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
3 years agoqa/rgw: temporarily disable multisite reshard tests
Casey Bodley [Tue, 25 May 2021 18:37:26 +0000 (14:37 -0400)]
qa/rgw: temporarily disable multisite reshard tests

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agotest/rgw: add multisite test for full sync after reshard
Casey Bodley [Fri, 30 Apr 2021 20:22:33 +0000 (16:22 -0400)]
test/rgw: add multisite test for full sync after reshard

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agotest/rgw: add simple multisite reshard test
Casey Bodley [Fri, 30 Apr 2021 19:08:39 +0000 (15:08 -0400)]
test/rgw: add simple multisite reshard test

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agoradosgw-admin: 'bucket sync checkpoint' waits for generation to catch up
Casey Bodley [Tue, 18 May 2021 19:55:28 +0000 (15:55 -0400)]
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>
3 years agorgw: get_bucket_instance_ids() uses num_shards from layout
Casey Bodley [Wed, 19 May 2021 18:03:48 +0000 (14:03 -0400)]
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>
3 years agorgw: rgw_read_remote_bilog_info() returns rgw_bucket_index_marker_info
Casey Bodley [Thu, 20 May 2021 15:15:26 +0000 (11:15 -0400)]
rgw: rgw_read_remote_bilog_info() returns rgw_bucket_index_marker_info

Signed-off-by: Casey Bodley <cbodley@redhat.com>
3 years agorgw: adding generation number to async notification
Shilpa Jagannath [Mon, 15 Feb 2021 14:46:29 +0000 (20:16 +0530)]
rgw: adding generation number to async notification

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
3 years agorgw: add custom json encode/decode for the v1 notify API
Casey Bodley [Tue, 23 Feb 2021 19:55:50 +0000 (14:55 -0500)]
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>
3 years agotest/rgw: fix python error on test failure
Casey Bodley [Fri, 14 May 2021 17:49:09 +0000 (13:49 -0400)]
test/rgw: fix python error on test failure

Signed-off-by: Casey Bodley <cbodley@redhat.com>