]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: rgw_read_bucket_inc_sync_status doesn't need bucket info
authorCasey Bodley <cbodley@redhat.com>
Thu, 19 Aug 2021 20:12:21 +0000 (16:12 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 28 Apr 2022 16:56:49 +0000 (12:56 -0400)
all we need to construct the per-shard bucket sync status object names
are the bucket names themselves, which we already have from
rgw_sync_bucket_pipe

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_data_sync.cc
src/rgw/rgw_data_sync.h
src/rgw/rgw_rest_log.cc
src/rgw/rgw_sync_checkpoint.cc

index 836ad3dbb5d22feee80a7ed7029d24f93ab84b75..017751ecd52ace80b1806dec289bf1fdc7e29d1a 100644 (file)
@@ -2538,7 +2538,7 @@ static int bucket_source_sync_status(const DoutPrefixProvider *dpp, rgw::sal::Ra
 
   std::vector<rgw_bucket_shard_sync_info> status;
   status.resize(full_status.shards_done_with_gen.size());
-  r = rgw_read_bucket_inc_sync_status(dpp, store, pipe, bucket_info, &source_bucket->get_info(), full_status.incremental_gen,  &status);
+  r = rgw_read_bucket_inc_sync_status(dpp, store, pipe, full_status.incremental_gen, &status);
   if (r < 0) {
     lderr(store->ctx()) << "failed to read bucket incremental sync status: " << cpp_strerror(r) << dendl;
     return r;
index b225d2e7b0a06c86af6ecba67bec29994403a63c..f47f3e739e2db766917a4dd2c75bea838fb5e6b3 100644 (file)
@@ -5710,19 +5710,13 @@ class RGWCollectBucketSyncStatusCR : public RGWShardCollectCR {
   }
  public:
   RGWCollectBucketSyncStatusCR(rgw::sal::RadosStore* store, RGWDataSyncCtx *sc,
-                               const RGWBucketInfo& source_bucket_info,
-                               const RGWBucketInfo& dest_bucket_info,
+                               const rgw_bucket_sync_pair_info& sync_pair,
                                uint64_t gen,
                                Vector *status)
     : RGWShardCollectCR(sc->cct, max_concurrent_shards),
-      store(store), sc(sc), env(sc->env), gen(gen),
+      store(store), sc(sc), env(sc->env), gen(gen), sync_pair(sync_pair),
       i(status->begin()), end(status->end())
-  {
-    // This function doesn't need to know the remote shard count, but
-    // callers of read_bucket_inc_sync_status do
-    sync_pair.source_bs = rgw_bucket_shard(source_bucket_info.bucket, 0);
-    sync_pair.dest_bucket = dest_bucket_info.bucket;
-  }
+  {}
 
   bool spawn_next() override {
     if (i == end) {
@@ -5769,8 +5763,6 @@ int rgw_read_bucket_full_sync_status(const DoutPrefixProvider *dpp,
 int rgw_read_bucket_inc_sync_status(const DoutPrefixProvider *dpp,
                                     rgw::sal::RadosStore *store,
                                     const rgw_sync_bucket_pipe& pipe,
-                                    const RGWBucketInfo& dest_bucket_info,
-                                    const RGWBucketInfo *psource_bucket_info,
                                     uint64_t gen,
                                     std::vector<rgw_bucket_shard_sync_info> *status)
 {
@@ -5781,27 +5773,10 @@ int rgw_read_bucket_inc_sync_status(const DoutPrefixProvider *dpp,
     return -EINVAL;
   }
 
-  if (*pipe.dest.bucket !=
-      dest_bucket_info.bucket) {
-    return -EINVAL;
-  }
-
-  const rgw_bucket& source_bucket = *pipe.source.bucket;
-
-  RGWBucketInfo source_bucket_info;
-
-  if (!psource_bucket_info) {
-    auto& bucket_ctl = store->getRados()->ctl.bucket;
-
-    int ret = bucket_ctl->read_bucket_info(source_bucket, &source_bucket_info, null_yield, dpp);
-    if (ret < 0) {
-      ldpp_dout(dpp, 0) << "ERROR: failed to get bucket instance info: bucket=" << source_bucket << ": " << cpp_strerror(-ret) << dendl;
-      return ret;
-    }
-
-    psource_bucket_info = &source_bucket_info;
-  }
-
+  rgw_bucket_sync_pair_info sync_pair;
+  sync_pair.source_bs.bucket = *pipe.source.bucket;
+  sync_pair.source_bs.shard_id = 0;
+  sync_pair.dest_bucket = *pipe.dest.bucket;
 
   RGWDataSyncEnv env;
   RGWSyncModuleInstanceRef module; // null sync module
@@ -5813,8 +5788,7 @@ int rgw_read_bucket_inc_sync_status(const DoutPrefixProvider *dpp,
 
   RGWCoroutinesManager crs(store->ctx(), store->getRados()->get_cr_registry());
   return crs.run(dpp, new RGWCollectBucketSyncStatusCR(store, &sc,
-                                                  *psource_bucket_info,
-                                                  dest_bucket_info,
+                                                  sync_pair,
                                                   gen,
                                                   status));
 }
index 88c0db42f605df72805e618f800d562de48b20d4..bc0063e9e0fe1c7190002a6b3c8c56fd718fdca6 100644 (file)
@@ -779,8 +779,6 @@ int rgw_read_bucket_full_sync_status(const DoutPrefixProvider *dpp,
 int rgw_read_bucket_inc_sync_status(const DoutPrefixProvider *dpp,
                                     rgw::sal::RadosStore *store,
                                     const rgw_sync_bucket_pipe& pipe,
-                                    const RGWBucketInfo& dest_bucket_info,
-                                    const RGWBucketInfo *psource_bucket_info,
                                     uint64_t gen,
                                     std::vector<rgw_bucket_shard_sync_info> *status);
 
index f138c9e77b5253ee4892cc53de8700d3cc42b67a..9c6ec608b8d2f72dba498386439591a39a18ea0a 100644 (file)
@@ -1012,8 +1012,6 @@ void RGWOp_BILog_Status::execute(optional_yield y)
       this,
       static_cast<rgw::sal::RadosStore*>(store),
       pipe,
-      bucket->get_info(),
-      nullptr,
       status.sync_status.incremental_gen,
       &status.inc_status);
     if (op_ret < 0) {
@@ -1076,7 +1074,7 @@ void RGWOp_BILog_Status::execute(optional_yield y)
 
     current_status.resize(status.sync_status.shards_done_with_gen.size());
     int r = rgw_read_bucket_inc_sync_status(this, static_cast<rgw::sal::RadosStore*>(store),
-                                           pipe, *pinfo, &bucket->get_info(), status.sync_status.incremental_gen, &current_status);
+                                           pipe, status.sync_status.incremental_gen, &current_status);
     if (r < 0) {
       ldpp_dout(this, -1) << "ERROR: rgw_read_bucket_inc_sync_status() on pipe=" << pipe << " returned ret=" << r << dendl;
       op_ret = r;
index b07cec1a05a00a9228b863ef2fa38f9fe0e216f5..99bdddb6183fcd8dc3faf447b59e87145e0ed6e3 100644 (file)
@@ -144,8 +144,8 @@ int bucket_source_sync_checkpoint(const DoutPrefixProvider* dpp,
 
   std::vector<rgw_bucket_shard_sync_info> status;
   status.resize(std::max<size_t>(1, num_shards));
-  r = rgw_read_bucket_inc_sync_status(dpp, store, pipe, bucket_info,
-                                      &source_bucket_info, full_status.incremental_gen, &status);
+  r = rgw_read_bucket_inc_sync_status(dpp, store, pipe,
+                                      full_status.incremental_gen, &status);
   if (r < 0) {
     return r;
   }
@@ -160,8 +160,8 @@ int bucket_source_sync_checkpoint(const DoutPrefixProvider* dpp,
         << "      local status: " << status << '\n'
         << "    remote markers: " << remote_markers << dendl;
     std::this_thread::sleep_until(delay_until);
-    r = rgw_read_bucket_inc_sync_status(dpp, store, pipe, bucket_info,
-                                        &source_bucket_info, full_status.incremental_gen, &status);
+    r = rgw_read_bucket_inc_sync_status(dpp, store, pipe,
+                                        full_status.incremental_gen, &status);
     if (r < 0) {
       return r;
     }