]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Disentangle init_sync_status from RemoteBucketManager
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 13 Apr 2022 02:10:31 +0000 (22:10 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:34 +0000 (15:47 -0400)
RGWRemoteBucketManager's current design isn't really compatible with
what we need for bucket sync run to work as the number of shards
changes from run to run.

We can make a smaller 'hold information common to all three
operations' class and simplify things a bit.

We also need to fetch `rgw_bucket_index_marker_info` and supply it to
`InitBucketFullSyncStatusCR` to ensure we have the correct generation
and shard count.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_data_sync.cc

index b35e36c230dc7747b962290832ac36dfcfb011f4..e947879363e1ec3a55b156eaee81533a50ff3a31 100644 (file)
@@ -5470,15 +5470,20 @@ RGWBucketPipeSyncStatusManager::construct(
 int RGWBucketPipeSyncStatusManager::init_sync_status(const DoutPrefixProvider *dpp)
 {
   list<RGWCoroutinesStack *> stacks;
-  // pass an empty objv tracker to each so that the version gets incremented
-  std::list<RGWObjVersionTracker> objvs;
-  std::list<rgw_bucket_index_marker_info> infos;
+  std::vector<rgw_raw_obj> full_status_objs;
+  std::vector<rgw_bucket_sync_status> full_status;
 
-  for (auto& mgr : source_mgrs) {
+  for (auto& source : sources) {
     RGWCoroutinesStack *stack = new RGWCoroutinesStack(store->ctx(), &cr_mgr);
-    objvs.emplace_back();
-    infos.emplace_back();
-    stack->call(mgr.init_sync_status_cr(objvs.back(), infos.back()));
+    full_status_objs.emplace_back(
+      sync_env.svc->zone->get_zone_params().log_pool,
+      full_status_oid(source.sc.source_zone, source.info.bucket, source.dest));
+
+    full_status.emplace_back();
+
+    stack->call(new RGWSimpleRadosWriteCR<rgw_bucket_sync_status>(
+                 dpp, source.sc.env->async_rados, source.sc.env->svc->sysobj,
+                 full_status_objs.back(), full_status.back()));
 
     stacks.push_back(stack);
   }