]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: rgw_read_remote_bilog_info() returns rgw_bucket_index_marker_info
authorCasey Bodley <cbodley@redhat.com>
Thu, 20 May 2021 15:15:26 +0000 (11:15 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:32 +0000 (15:47 -0400)
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_sync_checkpoint.cc

index b6460e13464a84f7d8938231e23f9aff6d7be227..14511b0ff6d7fc39efc68d0054eddfac858760c1 100644 (file)
@@ -2525,8 +2525,10 @@ static int bucket_source_sync_status(const DoutPrefixProvider *dpp, rgw::sal::Ra
 
   out << indented{width} << "incremental sync on " << total_shards << " shards\n";
 
+  rgw_bucket_index_marker_info remote_info;
   BucketIndexShardsManager remote_markers;
-  r = rgw_read_remote_bilog_info(dpp, conn, source_bucket->get_key(), remote_markers, null_yield);
+  r = rgw_read_remote_bilog_info(dpp, conn, source_bucket->get_key(),
+                                 remote_info, remote_markers, null_yield);
   if (r < 0) {
     ldpp_dout(dpp, -1) << "failed to read remote log: " << cpp_strerror(r) << dendl;
     return r;
index 6e0ef433cd303d998857a300bc44ac801db6bbef..d53654d6978070b34327cb87039bc53114682735 100644 (file)
@@ -5502,6 +5502,7 @@ string RGWBucketPipeSyncStatusManager::obj_status_oid(const rgw_bucket_sync_pipe
 int rgw_read_remote_bilog_info(const DoutPrefixProvider *dpp,
                                RGWRESTConn* conn,
                                const rgw_bucket& bucket,
+                               rgw_bucket_index_marker_info& info,
                                BucketIndexShardsManager& markers,
                                optional_yield y)
 {
@@ -5512,15 +5513,15 @@ int rgw_read_remote_bilog_info(const DoutPrefixProvider *dpp,
     { "info" , nullptr },
     { nullptr, nullptr }
   };
-  rgw_bucket_index_marker_info result;
-  int r = conn->get_json_resource(dpp, "/admin/log/", params, y, result);
+  int r = conn->get_json_resource(dpp, "/admin/log/", params, y, info);
   if (r < 0) {
     ldpp_dout(dpp, -1) << "failed to fetch remote log markers: " << cpp_strerror(r) << dendl;
     return r;
   }
-  r = markers.from_string(result.max_marker, -1);
+  // parse shard markers
+  r = markers.from_string(info.max_marker, -1);
   if (r < 0) {
-    lderr(conn->get_ctx()) << "failed to decode remote log markers" << dendl;
+    ldpp_dout(dpp, -1) << "failed to decode remote log markers" << dendl;
     return r;
   }
   return 0;
index 97533b4d82c8e9bf03474ea48551983396082745..82e1172ee66b1940e542a80385c85050854820e2 100644 (file)
@@ -698,6 +698,7 @@ class BucketIndexShardsManager;
 int rgw_read_remote_bilog_info(const DoutPrefixProvider *dpp,
                                RGWRESTConn* conn,
                                const rgw_bucket& bucket,
+                               rgw_bucket_index_marker_info& info,
                                BucketIndexShardsManager& markers,
                                optional_yield y);
 
index ae8c8c02b4656132a9373e8fb2ab0974e1a4feb8..e0a82fcd6a9a3534321481b6e0cbb84e22a09f37 100644 (file)
@@ -145,11 +145,12 @@ int bucket_source_sync_checkpoint(const DoutPrefixProvider* dpp,
   return 0;
 }
 
-int source_bilog_markers(const DoutPrefixProvider *dpp,
-                         RGWSI_Zone* zone_svc,
-                         const rgw_sync_bucket_pipe& pipe,
-                         BucketIndexShardsManager& remote_markers,
-                         optional_yield y)
+int source_bilog_info(const DoutPrefixProvider *dpp,
+                      RGWSI_Zone* zone_svc,
+                      const rgw_sync_bucket_pipe& pipe,
+                      rgw_bucket_index_marker_info& info,
+                      BucketIndexShardsManager& markers,
+                      optional_yield y)
 {
   ceph_assert(pipe.source.zone);
 
@@ -160,7 +161,7 @@ int source_bilog_markers(const DoutPrefixProvider *dpp,
   }
 
   return rgw_read_remote_bilog_info(dpp, conn->second, *pipe.source.bucket,
-                                    remote_markers, y);
+                                    info, markers, y);
 }
 
 } // anonymous namespace
@@ -198,8 +199,9 @@ int rgw_bucket_sync_checkpoint(const DoutPrefixProvider* dpp,
     // fetch remote markers
     spawn::spawn(ioctx, [&] (yield_context yield) {
       auto y = optional_yield{ioctx, yield};
-      int r = source_bilog_markers(dpp, store->svc()->zone, entry.pipe,
-                                   entry.remote_markers, y);
+      rgw_bucket_index_marker_info info;
+      int r = source_bilog_info(dpp, store->svc()->zone, entry.pipe,
+                                info, entry.remote_markers, y);
       if (r < 0) {
         ldpp_dout(dpp, 0) << "failed to fetch remote bilog markers: "
             << cpp_strerror(r) << dendl;