]> 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>
Tue, 1 Feb 2022 23:16:59 +0000 (18:16 -0500)
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 d6803e64cc0133ee49d5b11862625f48bbae5864..ba508b0783f1d51001c0052106ef02f261486589 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();
   }
@@ -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,