]> 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>
Mon, 13 Sep 2021 16:27:50 +0000 (12:27 -0400)
* 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 b51e7b939783a26ba433a16c6ee5c8c7cbc77c2f..c115a5feda1a6d6c5c14b148a7b1cab3c34b7b8a 100644 (file)
@@ -2997,7 +2997,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;
   }
@@ -3019,7 +3019,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;
@@ -3100,7 +3100,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;
   }