]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: enforce spawn_window for data full sync
authorCasey Bodley <cbodley@redhat.com>
Fri, 10 Aug 2018 20:34:42 +0000 (16:34 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 7 Sep 2018 15:18:23 +0000 (11:18 -0400)
limit the number of concurrent bucket sync crs spawned by data full sync

Fixes: http://tracker.ceph.com/issues/26897
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc

index 7d841c19641b19802288304a45cd6ab856f7b32b..f4176ce049eabc77815046c3869f670c300d4445 100644 (file)
@@ -1337,13 +1337,19 @@ public:
           } else {
             // fetch remote and write locally
             yield spawn(new RGWDataSyncSingleEntryCR(sync_env, *iter, *iter, marker_tracker, error_repo, false, tn), false);
-            if (retcode < 0) {
-              lease_cr->go_down();
-              drain_all();
-              return set_cr_error(retcode);
-            }
           }
           sync_marker.marker = *iter;
+
+          while ((int)num_spawned() > spawn_window) {
+            set_status() << "num_spawned() > spawn_window";
+            yield wait_for_child();
+            int ret;
+            while (collect(&ret, lease_stack.get())) {
+              if (ret < 0) {
+                tn->log(10, "a sync operation returned error");
+              }
+            }
+          }
         }
       } while (omapkeys->more);
       omapkeys.reset();