]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix for assertion in RGWMetaSyncCR 11477/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 16 Aug 2016 14:01:07 +0000 (10:01 -0400)
committerLoic Dachary <ldachary@redhat.com>
Wed, 9 Nov 2016 11:26:35 +0000 (12:26 +0100)
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>
(cherry picked from commit ced2eb2c7301d51e6bb190ef02c8590291e723a8)

src/rgw/rgw_sync.cc

index 3d494efed65e139d08f37373c98889536fa64550..437df14f9929c15de830e2c2e4f5c71d719158ca 100644 (file)
@@ -1672,6 +1672,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,
@@ -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