From: Casey Bodley Date: Tue, 14 Aug 2018 17:06:50 +0000 (-0400) Subject: rgw: return errors from RGWInitBucketShardSyncStatusCoroutine X-Git-Tag: v12.2.9~27^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2c07f2aef713d82aaa378ba7f2680b08bceff232;p=ceph.git rgw: return errors from RGWInitBucketShardSyncStatusCoroutine return ENOENT so caller can detect whether sync is stopped Signed-off-by: Casey Bodley (cherry picked from commit 72ac0aa1bb5bdffb06b1df8469206b3967a59aa0) --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 5aac1833bbe7..2a95f6d131a3 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #include #include "common/ceph_json.h" @@ -1892,6 +1895,12 @@ public: call(new RGWSimpleRadosWriteAttrsCR(sync_env->async_rados, store, obj, attrs)); } } + if (info.syncstopped) { + retcode = -ENOENT; + } + if (retcode < 0) { + return set_cr_error(retcode); + } return set_cr_done(); } return 0; @@ -3055,6 +3064,12 @@ int RGWRunBucketSyncCoroutine::operate() if (sync_status.state == rgw_bucket_shard_sync_info::StateInit) { yield call(new RGWInitBucketShardSyncStatusCoroutine(sync_env, bs, sync_status)); + if (retcode == -ENOENT) { + tn->log(0, "bucket sync disabled"); + lease_cr->go_down(); + drain_all(); + return set_cr_done(); + } if (retcode < 0) { ldout(sync_env->cct, 0) << "ERROR: init sync on " << bucket_shard_str{bs} << " failed, retcode=" << retcode << dendl;