Skip to content

rgw/multisite: allow bucket sync disable/enable#41404

Merged
cbodley merged 4 commits intoceph:wip-rgw-multisite-reshardfrom
yuvalif:wip-yuval-disable-bucket-sync2
Jul 27, 2021
Merged

rgw/multisite: allow bucket sync disable/enable#41404
cbodley merged 4 commits intoceph:wip-rgw-multisite-reshardfrom
yuvalif:wip-yuval-disable-bucket-sync2

Conversation

@yuvalif
Copy link
Contributor

@yuvalif yuvalif commented May 19, 2021

Signed-off-by: Yuval Lifshitz ylifshit@redhat.com


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

// 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));
Copy link
Contributor

Choose a reason for hiding this comment

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

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()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. will do that in a separate commit, as this should not change functionality here

@yuvalif yuvalif force-pushed the wip-yuval-disable-bucket-sync2 branch from eaf3fd8 to 92531f2 Compare May 27, 2021 15:56
@yuvalif
Copy link
Contributor Author

yuvalif commented Jun 1, 2021

jenkins test make check

@yuvalif yuvalif force-pushed the wip-yuval-disable-bucket-sync2 branch from 92531f2 to a9898d7 Compare June 9, 2021 14:20
@github-actions
Copy link

github-actions bot commented Jun 9, 2021

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@yuvalif yuvalif force-pushed the wip-yuval-disable-bucket-sync2 branch from a9898d7 to b3cc52e Compare June 9, 2021 15:09
@yuvalif
Copy link
Contributor Author

yuvalif commented Jun 9, 2021

test_bucket_sync_disable() and test_bucket_sync_disable_enable() - passing
test_bucket_sync_enable_right_after_disable() - failing

@yuvalif yuvalif force-pushed the wip-yuval-disable-bucket-sync2 branch from b3cc52e to 19ea5b3 Compare June 14, 2021 14:06
@yuvalif
Copy link
Contributor Author

yuvalif commented Jun 14, 2021

all disable/enable tests are now passing

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

{}

bool spawn_next() override {
if (shard >= num_shards || status < 0) { // stop spawning on any errors
Copy link
Contributor

Choose a reason for hiding this comment

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

if we get an error like ENOENT trying to delete a shard, we should still try to delete the rest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ENOENT is converted to success in the called CR

Copy link
Contributor

Choose a reason for hiding this comment

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

there may be other error codes. i think we should drop the comment and || status < 0 part

yuvalif added 3 commits June 15, 2021 20:22
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>
@yuvalif yuvalif force-pushed the wip-yuval-disable-bucket-sync2 branch from 19ea5b3 to 52f3113 Compare June 16, 2021 09:34
} else if (retcode != -EEXIST) {
yield call(new RGWInitBucketShardSyncStatusCoroutine(sc, pair, status, gen, marker_mgr, objv, false));
if (retcode < 0) {
assert(retcode != -EEXIST && retcode != -ECANCELED);
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm not sure this is a good reason to crash, can we take out the assert?

{}

bool spawn_next() override {
if (shard >= num_shards || status < 0) { // stop spawning on any errors
Copy link
Contributor

Choose a reason for hiding this comment

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

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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

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=cpp

for vim, i enabled this with set modeline in my .vimrc

public:
RemoveBucketShardStatusCollectCR(RGWDataSyncCtx* sc,
const rgw_bucket_sync_pair_info& sync_pair,
uint64_t gen,
Copy link
Contributor

Choose a reason for hiding this comment

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

too many tabs

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure this is helpful since the coroutine logging will already show CheckAllBucketShardStatusIsIncremental?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. will remove

return set_cr_error(retcode);
}
}
if (bucket_status.state == BucketSyncState::Incremental) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we just set bucket_status.state = BucketSyncState::Stopped; in the block above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right. i should move this block before the one that update the bucket wide state object

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));
Copy link
Contributor

Choose a reason for hiding this comment

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

tabs

}
RELEASE_LOCK(bucket_lease_cr);
return set_cr_done();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

tabs

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>
@yuvalif yuvalif force-pushed the wip-yuval-disable-bucket-sync2 branch from 52f3113 to 01a9d9d Compare June 16, 2021 15:08
@cbodley cbodley merged commit 01a9d9d into ceph:wip-rgw-multisite-reshard Jul 27, 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.

2 participants