]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix for assertion in RGWMetaSyncCR 10743/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 16 Aug 2016 14:01:07 +0000 (10:01 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 16 Aug 2016 15:00:20 +0000 (11:00 -0400)
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 <cbodley@redhat.com>
src/rgw/rgw_sync.cc

index e0506650f77c7ab82dde545614f076aee445dccc..8d6b1f5bc7110b159c58896ba3a1d2136e9913c3 100644 (file)
@@ -1681,6 +1681,7 @@ class RGWMetaSyncCR : public RGWCoroutine {
   using StackRef = boost::intrusive_ptr<RGWCoroutinesStack>;
   using RefPair = std::pair<ControlCRRef, StackRef>;
   map<int, RefPair> 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