From: Casey Bodley Date: Tue, 16 Aug 2016 14:01:07 +0000 (-0400) Subject: rgw: fix for assertion in RGWMetaSyncCR X-Git-Tag: v10.2.6~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6c1edcd5083e142b819de0a0576cb6bfa74b0176;p=ceph.git rgw: fix for assertion in RGWMetaSyncCR while testing with multiple gateways per zone, i started seeing omap-get-keys requests fail with EIO. this led to a failed 'assert(next)' in RGWMetaSyncCR due to a bug in error handling Fixes: http://tracker.ceph.com/issues/17044 Signed-off-by: Casey Bodley (cherry picked from commit ced2eb2c7301d51e6bb190ef02c8590291e723a8) --- diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 3d494efed65e..437df14f9929 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -1672,6 +1672,7 @@ class RGWMetaSyncCR : public RGWCoroutine { using StackRef = boost::intrusive_ptr; using RefPair = std::pair; map shard_crs; + int ret{0}; public: RGWMetaSyncCR(RGWMetaSyncEnv *_sync_env, RGWPeriodHistory::Cursor cursor, @@ -1681,7 +1682,6 @@ public: cursor(cursor), sync_status(_sync_status) {} int operate() { - int ret = 0; reenter(this) { // loop through one period at a time for (;;) { @@ -1734,7 +1734,10 @@ public: } } // wait for each shard to complete - collect(&ret, NULL); + while (ret == 0 && num_spawned() > 0) { + yield wait_for_child(); + collect(&ret, nullptr); + } drain_all(); { // drop shard cr refs under lock