From aaf4bc134fccb54ca6d7bc17122fa87eb67870c0 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 22 Nov 2021 14:23:01 -0500 Subject: [PATCH] rgw/multisite: handle shard_progress correctly in RunBucketSources we run bucket sync on each of the sync pipes, so size the vector accordingly Signed-off-by: Casey Bodley --- src/rgw/rgw_data_sync.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 87f4a1c53ce..5764583c475 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1225,6 +1225,10 @@ struct rgw_sync_pipe_info_set { return handlers.end(); } + size_t size() const { + return handlers.size(); + } + bool empty() const { return handlers.empty(); } @@ -4729,7 +4733,10 @@ int RGWRunBucketSourcesSyncCR::operate(const DoutPrefixProvider *dpp) return set_cr_done(); } - for (siter = pipes.begin(); siter != pipes.end(); ++siter) { + shard_progress.resize(pipes.size()); + cur_shard_progress = shard_progress.begin(); + + for (siter = pipes.begin(); siter != pipes.end(); ++siter, ++cur_shard_progress) { ldpp_dout(dpp, 20) << __func__ << "(): sync pipe=" << *siter << dendl; sync_pair.dest_bucket = siter->target.get_bucket(); @@ -4737,9 +4744,6 @@ int RGWRunBucketSourcesSyncCR::operate(const DoutPrefixProvider *dpp) ldpp_dout(dpp, 20) << __func__ << "(): sync_pair=" << sync_pair << dendl; - shard_progress.resize(1); - cur_shard_progress = shard_progress.begin(); - yield_spawn_window(sync_bucket_shard_cr(sc, lease_cr, sync_pair, gen, tn, &*cur_shard_progress), BUCKET_SYNC_SPAWN_WINDOW, -- 2.47.3