]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: read shard count using remote bilog info during bucket sync
authorShilpa Jagannath <smanjara@redhat.com>
Thu, 10 Jun 2021 16:51:21 +0000 (22:21 +0530)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:33 +0000 (15:47 -0400)
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/rgw_data_sync.cc

index 6a2a19da00355e1735b9cad8cbe12149472c970d..92d4532c8b15b17c7fac926add089b3c6204b53b 100644 (file)
@@ -2805,8 +2805,11 @@ RGWRemoteBucketManager::RGWRemoteBucketManager(const DoutPrefixProvider *_dpp,
                                                                     source_bucket_info.bucket,
                                                                     dest_bucket))
 {
-  int num_shards = (source_bucket_info.layout.current_index.layout.normal.num_shards <= 0 ? 
-                    1 : source_bucket_info.layout.current_index.layout.normal.num_shards);
+  rgw_bucket_index_marker_info remote_info;
+  BucketIndexShardsManager remote_markers;
+  rgw_read_remote_bilog_info(dpp, conn, source_bucket_info.bucket,
+                             remote_info, remote_markers, null_yield);
+  int num_shards = remote_markers.get().size();
 
   sync_pairs.resize(num_shards);
 
@@ -5159,6 +5162,8 @@ class RGWSyncBucketCR : public RGWCoroutine {
   rgw_bucket_index_marker_info info;
 
   RGWSyncTraceNodeRef tn;
+  rgw_bucket_index_marker_info remote_info;
+  BucketIndexShardsManager remote_markers;
 
 public:
   RGWSyncBucketCR(RGWDataSyncCtx *_sc,
@@ -5341,7 +5346,9 @@ int RGWSyncBucketCR::operate(const DoutPrefixProvider *dpp)
         // init sync status
         yield {
           init_check_compat = objv.read_version.ver <= 1; // newly-created
-          const int num_shards = sync_pipe.dest_bucket_info.layout.current_index.layout.normal.num_shards;
+          rgw_read_remote_bilog_info(dpp, sc->conn, sync_pair.source_bs.bucket,
+                                      remote_info, remote_markers, null_yield);
+          const int num_shards = remote_markers.get().size();
           call(new InitBucketFullSyncStatusCR(sc, sync_pair, status_obj,
                                               bucket_status, objv, num_shards,
                                               init_check_compat, info));