From: Casey Bodley Date: Thu, 19 Aug 2021 20:30:49 +0000 (-0400) Subject: rgw: resize status vector before reading inc_sync_status X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=729b3e76adced50dc73bf4fc3533c20d6f5fdfbe;p=ceph.git rgw: resize status vector before reading inc_sync_status rgw_read_bucket_inc_sync_status() uses the size of this vector as the 'num_shards', so we need to resize it appropriately beforehand Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 6443ef4c4d64e..72e2d3fea50da 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2537,6 +2537,7 @@ static int bucket_source_sync_status(const DoutPrefixProvider *dpp, rgw::sal::Ra } std::vector 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); if (r < 0) { lderr(store->ctx()) << "failed to read bucket incremental sync status: " << cpp_strerror(r) << dendl; diff --git a/src/rgw/rgw_rest_log.cc b/src/rgw/rgw_rest_log.cc index 985319271505d..f138c9e77b525 100644 --- a/src/rgw/rgw_rest_log.cc +++ b/src/rgw/rgw_rest_log.cc @@ -1006,6 +1006,7 @@ void RGWOp_BILog_Status::execute(optional_yield y) ldpp_dout(this, -1) << "ERROR: rgw_read_bucket_full_sync_status() on pipe=" << pipe << " returned ret=" << op_ret << dendl; return; } + status.inc_status.resize(status.sync_status.shards_done_with_gen.size()); op_ret = rgw_read_bucket_inc_sync_status( this, @@ -1073,6 +1074,7 @@ void RGWOp_BILog_Status::execute(optional_yield y) return; } + current_status.resize(status.sync_status.shards_done_with_gen.size()); int r = rgw_read_bucket_inc_sync_status(this, static_cast(store), pipe, *pinfo, &bucket->get_info(), status.sync_status.incremental_gen, ¤t_status); if (r < 0) {