]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: fix bucket shard state init function
authorYuval Lifshitz <ylifshit@redhat.com>
Fri, 14 May 2021 09:27:09 +0000 (12:27 +0300)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 1 Feb 2022 17:53:09 +0000 (12:53 -0500)
* make sure src/dest shard ids are the same in sync pair
* copy sync pair by value in coroutine loop

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_data_sync.cc

index c8371fc2d834b1490fe079f988b930e5ac805e0e..fa220e3812072a21c5d60ea8423ae42b2d399238 100644 (file)
@@ -3003,7 +3003,7 @@ class CheckAllBucketShardStatusIsIncremental : public RGWShardCollectCR {
     if (shard >= num_shards || status < 0 || !*result) {
       return false;
     }
-    sync_pair.dest_bs.shard_id = shard++;
+    sync_pair.dest_bs.shard_id = sync_pair.source_bs.shard_id = shard++;
     spawn(new CheckBucketShardStatusIsIncremental(sc, sync_pair, result), false);
     return true;
   }
@@ -3025,7 +3025,7 @@ class CheckAllBucketShardStatusIsIncremental : public RGWShardCollectCR {
 // and a loop to retry on racing writes
 class InitBucketShardStatusCR : public RGWCoroutine {
   RGWDataSyncCtx* sc;
-  const rgw_bucket_sync_pair_info& pair;
+  rgw_bucket_sync_pair_info pair;
   rgw_bucket_shard_sync_info status;
   RGWObjVersionTracker objv;
   rgw_bucket_index_marker_info& info;
@@ -3106,7 +3106,7 @@ class InitBucketShardStatusCollectCR : public RGWShardCollectCR {
     if (shard >= num_shards || status < 0) { // stop spawning on any errors
       return false;
     }
-    sync_pair.dest_bs.shard_id = shard++;
+    sync_pair.dest_bs.shard_id = sync_pair.source_bs.shard_id = shard++;
     spawn(new InitBucketShardStatusCR(sc, sync_pair, info, marker_mgr), false);
     return true;
   }