]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RunBucketSourcesSync returns errors from RunBucketSync
authorCasey Bodley <cbodley@redhat.com>
Wed, 5 Feb 2020 17:49:29 +0000 (12:49 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 5 Feb 2020 17:56:18 +0000 (12:56 -0500)
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 <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc

index a32eae257999779d38c4c5d2696775b92ab37ed3..a419e3d06593a2357abec7c550bac59e8cf6e877 100644 (file)
@@ -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();
   }