From: Casey Bodley Date: Wed, 5 Feb 2020 17:49:29 +0000 (-0500) Subject: rgw: RunBucketSourcesSync returns errors from RunBucketSync X-Git-Tag: v15.1.1~473^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=58a732ee0875552aef973b8e02a1eb5c078f9791;p=ceph.git rgw: RunBucketSourcesSync returns errors from RunBucketSync bucket sync errors need to be propagated back up to DataSyncSingleEntry so they can be written in the error_repo for retry Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index a32eae257999..a419e3d06593 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1261,6 +1261,7 @@ class RGWRunBucketSourcesSyncCR : public RGWCoroutine { int num_shards{0}; int cur_shard{0}; + bool again = false; public: RGWRunBucketSourcesSyncCR(RGWDataSyncCtx *_sc, @@ -4323,20 +4324,31 @@ int RGWRunBucketSourcesSyncCR::operate() while (num_spawned() > BUCKET_SYNC_SPAWN_WINDOW) { set_status() << "num_spawned() > spawn_window"; yield wait_for_child(); - bool again = true; + again = true; while (again) { again = collect(&ret, nullptr); if (ret < 0) { tn->log(10, "a sync operation returned error"); - /* we have reported this error */ + drain_all(); + return set_cr_error(ret); } - /* not waiting for child here */ } } } } - - drain_all(); + while (num_spawned()) { + set_status() << "draining"; + yield wait_for_child(); + again = true; + while (again) { + again = collect(&ret, nullptr); + if (ret < 0) { + tn->log(10, "a sync operation returned error"); + drain_all(); + return set_cr_error(ret); + } + } + } return set_cr_done(); }