]> 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)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 13 Sep 2021 16:28:34 +0000 (12:28 -0400)
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/rgw_data_sync.cc

index be716e9e61a3face7de5210f373928e0e934845d..43628191678191e62a564a5dd875b40f6b9d2dcb 100644 (file)
@@ -2814,8 +2814,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);
 
@@ -5168,6 +5171,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,
@@ -5350,7 +5355,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));