From 8f264278fc52a45369259d3b1f93db949c1b7cca Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 20 May 2021 11:15:26 -0400 Subject: [PATCH] rgw: rgw_read_remote_bilog_info() returns rgw_bucket_index_marker_info Signed-off-by: Casey Bodley --- src/rgw/rgw_admin.cc | 4 +++- src/rgw/rgw_data_sync.cc | 9 +++++---- src/rgw/rgw_data_sync.h | 1 + src/rgw/rgw_sync_checkpoint.cc | 18 ++++++++++-------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index b6460e13464a8..14511b0ff6d7f 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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; diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 6e0ef433cd303..d53654d697807 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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; diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index 97533b4d82c8e..82e1172ee66b1 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -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); diff --git a/src/rgw/rgw_sync_checkpoint.cc b/src/rgw/rgw_sync_checkpoint.cc index ae8c8c02b4656..e0a82fcd6a9a3 100644 --- a/src/rgw/rgw_sync_checkpoint.cc +++ b/src/rgw/rgw_sync_checkpoint.cc @@ -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; -- 2.39.5