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;
}
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) {
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)
{
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
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));
}
this,
static_cast<rgw::sal::RadosStore*>(store),
pipe,
- bucket->get_info(),
- nullptr,
status.sync_status.incremental_gen,
&status.inc_status);
if (op_ret < 0) {
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, ¤t_status);
+ pipe, status.sync_status.incremental_gen, ¤t_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;
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;
}
<< " 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;
}