From 65c1ff62ff6fdae09866e19a603b7d037bdaf330 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 10 Aug 2018 16:34:42 -0400 Subject: [PATCH] rgw: enforce spawn_window for data full sync 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 (cherry picked from commit 895c28a) Signed-off-by: Jonathan Brielmaier Conflicts: src/rgw/rgw_data_sync.cc: parameters in yield spawn --- src/rgw/rgw_data_sync.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 786761a92c06a..5f47ef8ae6374 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1268,13 +1268,19 @@ public: } else { // fetch remote and write locally yield spawn(new RGWDataSyncSingleEntryCR(sync_env, *iter, *iter, marker_tracker, error_repo, false), 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 ((int)entries.size() == max_entries); -- 2.39.5