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;
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)
{
{ "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;
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);
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);
}
return rgw_read_remote_bilog_info(dpp, conn->second, *pipe.source.bucket,
- remote_markers, y);
+ info, markers, y);
}
} // anonymous namespace
// 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;