From: Casey Bodley Date: Mon, 22 Nov 2021 19:23:01 +0000 (-0500) Subject: rgw/multisite: handle shard_progress correctly in RunBucketSources X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5306ba1030c62c4fce7b4246428b5866f76f41be;p=ceph.git 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 --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index d6803e64cc013..ba508b0783f1d 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(); } @@ -4744,7 +4748,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(); @@ -4752,9 +4759,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,