rgw/multisite: allow bucket sync disable/enable#41404
rgw/multisite: allow bucket sync disable/enable#41404cbodley merged 4 commits intoceph:wip-rgw-multisite-reshardfrom
Conversation
src/rgw/rgw_data_sync.cc
Outdated
| // try exclusive create with empty status | ||
| objv.generate_new_write_ver(cct); | ||
| yield call(new InitCR(sc, pair, status, info, marker_mgr, objv, exclusive)); | ||
| yield call(new InitCR(sc, pair, status, marker_mgr, objv, exclusive)); |
There was a problem hiding this comment.
as discussed in irc, i think it's safe to do away with the retry loop here in InitBucketShardStatusCR, and just do this initial write with exclusive=false so it never fails with EEXIST or ECANCELED
there may be racing writers, but Init should always win these races - this is accomplished by objv.generate_write_new_ver(), which will change the 'tag' in cls_version and cause other writers to fail on cls_version_check()
There was a problem hiding this comment.
ok. will do that in a separate commit, as this should not change functionality here
eaf3fd8 to
92531f2
Compare
|
jenkins test make check |
92531f2 to
a9898d7
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
a9898d7 to
b3cc52e
Compare
|
|
b3cc52e to
19ea5b3
Compare
|
all disable/enable tests are now passing |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
src/rgw/rgw_data_sync.cc
Outdated
| {} | ||
|
|
||
| bool spawn_next() override { | ||
| if (shard >= num_shards || status < 0) { // stop spawning on any errors |
There was a problem hiding this comment.
if we get an error like ENOENT trying to delete a shard, we should still try to delete the rest
There was a problem hiding this comment.
ENOENT is converted to success in the called CR
There was a problem hiding this comment.
there may be other error codes. i think we should drop the comment and || status < 0 part
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
when writign the sync status object Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
19ea5b3 to
52f3113
Compare
src/rgw/rgw_data_sync.cc
Outdated
| } else if (retcode != -EEXIST) { | ||
| yield call(new RGWInitBucketShardSyncStatusCoroutine(sc, pair, status, gen, marker_mgr, objv, false)); | ||
| if (retcode < 0) { | ||
| assert(retcode != -EEXIST && retcode != -ECANCELED); |
There was a problem hiding this comment.
i'm not sure this is a good reason to crash, can we take out the assert?
src/rgw/rgw_data_sync.cc
Outdated
| {} | ||
|
|
||
| bool spawn_next() override { | ||
| if (shard >= num_shards || status < 0) { // stop spawning on any errors |
There was a problem hiding this comment.
there may be other error codes. i think we should drop the comment and || status < 0 part
| int operate(const DoutPrefixProvider *dpp) override { | ||
| reenter(this) { | ||
| yield call(new RGWRadosRemoveCR(sync_env->store, obj, &objv)); | ||
| if (retcode < 0 && retcode != -ENOENT) { |
There was a problem hiding this comment.
too many tabs here and elsewhere. we treat tabs as 8 spaces, and your editor should be picking up these modelines:
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cppfor vim, i enabled this with set modeline in my .vimrc
src/rgw/rgw_data_sync.cc
Outdated
| public: | ||
| RemoveBucketShardStatusCollectCR(RGWDataSyncCtx* sc, | ||
| const rgw_bucket_sync_pair_info& sync_pair, | ||
| uint64_t gen, |
src/rgw/rgw_data_sync.cc
Outdated
| if (check_compat) { | ||
| // try to convert existing per-shard incremental status for backward compatibility | ||
| yield call(new CheckAllBucketShardStatusIsIncremental(sc, sync_pair, num_shards, &all_incremental)); | ||
| ldout(cct, 20) << "check for 'all incremental' in compatibility mode" << dendl; |
There was a problem hiding this comment.
not sure this is helpful since the coroutine logging will already show CheckAllBucketShardStatusIsIncremental?
src/rgw/rgw_data_sync.cc
Outdated
| return set_cr_error(retcode); | ||
| } | ||
| } | ||
| if (bucket_status.state == BucketSyncState::Incremental) { |
There was a problem hiding this comment.
we just set bucket_status.state = BucketSyncState::Stopped; in the block above
There was a problem hiding this comment.
right. i should move this block before the one that update the bucket wide state object
src/rgw/rgw_data_sync.cc
Outdated
| bucket_status.state == BucketSyncState::Stopped || | ||
| bucket_stopped) { | ||
| // if state is Init or Stopped, we query the remote RGW for ther state | ||
| yield call(new RGWReadRemoteBucketIndexLogInfoCR(sc, sync_pair.dest_bucket, &info)); |
src/rgw/rgw_data_sync.cc
Outdated
| } | ||
| RELEASE_LOCK(bucket_lease_cr); | ||
| return set_cr_done(); | ||
| } |
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>
52f3113 to
01a9d9d
Compare
Signed-off-by: Yuval Lifshitz ylifshit@redhat.com
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox