From: Casey Bodley Date: Mon, 22 Nov 2021 19:23:01 +0000 (-0500) Subject: rgw/multisite: handle shard_progress correctly in RunBucketSources X-Git-Tag: v18.0.0~787^2~59 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aaf4bc134fccb54ca6d7bc17122fa87eb67870c0;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 87f4a1c53ced..5764583c4757 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,