From 6aa1a283af585fa89dad57b53c9cf581362bb0b5 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 22 Mar 2022 16:42:55 -0400 Subject: [PATCH] rgw: data sync uses yield_spawn_window() restore concurrency to RGWDataSyncShardCR by replacing drain_all_but_stack_cb() with yield_spawn_window() Fixes: https://tracker.ceph.com/issues/55000 Signed-off-by: Casey Bodley (cherry picked from commit bfe9bd3aac4495763ca44c0995ca614e61d879ae) --- src/rgw/rgw_data_sync.cc | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 1e988d4ce33f..d50572653c36 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1592,17 +1592,11 @@ public: tn->log(0, SSTR("ERROR: cannot start syncing " << iter->first << ". Duplicate entry?")); } else { // fetch remote and write locally - spawn(sync_single_entry(source_bs, iter->first, iter->first, - entry_timestamp, false), false); + yield_spawn_window(sync_single_entry(source_bs, iter->first, iter->first, + entry_timestamp, false), + spawn_window, std::nullopt); } sync_marker.marker = iter->first; - - drain_all_but_stack_cb(lease_stack.get(), - [&](uint64_t stack_id, int ret) { - if (ret < 0) { - tn->log(10, "a sync operation returned error"); - } - }); } } while (omapvals->more); omapvals.reset(); @@ -1747,16 +1741,10 @@ public: if (!marker_tracker->start(log_iter->log_id, 0, log_iter->log_timestamp)) { tn->log(0, SSTR("ERROR: cannot start syncing " << log_iter->log_id << ". Duplicate entry?")); } else { - spawn(sync_single_entry(source_bs, log_iter->entry.key, log_iter->log_id, - log_iter->log_timestamp, false), false); + yield_spawn_window(sync_single_entry(source_bs, log_iter->entry.key, log_iter->log_id, + log_iter->log_timestamp, false), + spawn_window, std::nullopt); } - - drain_all_but_stack_cb(lease_stack.get(), - [&](uint64_t stack_id, int ret) { - if (ret < 0) { - tn->log(10, "a sync operation returned error"); - } - }); } tn->log(20, SSTR("shard_id=" << shard_id << " sync_marker=" << sync_marker.marker -- 2.47.3