From: Casey Bodley Date: Tue, 16 Aug 2016 14:01:07 +0000 (-0400) Subject: rgw: fix for assertion in RGWMetaSyncCR X-Git-Tag: v11.0.1~405^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ced2eb2c7301d51e6bb190ef02c8590291e723a8;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 --- diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index e0506650f77c..8d6b1f5bc711 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -1681,6 +1681,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, @@ -1690,7 +1691,6 @@ public: cursor(cursor), sync_status(_sync_status) {} int operate() { - int ret = 0; reenter(this) { // loop through one period at a time for (;;) { @@ -1743,7 +1743,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