]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: handle shard_progress correctly in RunBucketSources
authorCasey Bodley <cbodley@redhat.com>
Mon, 22 Nov 2021 19:23:01 +0000 (14:23 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 28 Apr 2022 17:19:40 +0000 (13:19 -0400)
we run bucket sync on each of the sync pipes, so size the vector
accordingly

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc

index 87f4a1c53cedd4c6974f316679f664d7ebc28ecd..5764583c47575e460bbde47e069a3a915c6fb8f0 100644 (file)
@@ -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,