Merge pull request #27898 from alimaredia/wip-rgw-thread-yield-context-get-bucket-info

Thread optional yield context through  get_bucket_info call path

Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2019-05-30 15:48:42 -04:00 committed by GitHub
commit 0e2b6f5c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 125 additions and 120 deletions

View File

@ -1188,10 +1188,10 @@ static int init_bucket(const string& tenant_name, const string& bucket_name, con
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r;
if (bucket_id.empty()) {
r = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, nullptr, pattrs);
r = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, nullptr, null_yield, pattrs);
} else {
string bucket_instance_id = bucket_name + ":" + bucket_id;
r = store->get_bucket_instance_info(obj_ctx, bucket_instance_id, bucket_info, NULL, pattrs);
r = store->get_bucket_instance_info(obj_ctx, bucket_instance_id, bucket_info, NULL, pattrs, null_yield);
}
if (r < 0) {
cerr << "could not get bucket info for bucket=" << bucket_name << std::endl;
@ -1372,7 +1372,7 @@ int set_bucket_quota(RGWRados *store, int opt_cmd,
RGWBucketInfo bucket_info;
map<string, bufferlist> attrs;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, NULL, &attrs);
int r = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, NULL, null_yield, &attrs);
if (r < 0) {
cerr << "could not get bucket info for bucket=" << bucket_name << ": " << cpp_strerror(-r) << std::endl;
return -r;
@ -1640,7 +1640,7 @@ int set_bucket_sync_enabled(RGWRados *store, int opt_cmd, const string& tenant_n
map<string, bufferlist> attrs;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, NULL, &attrs);
int r = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, NULL, null_yield, &attrs);
if (r < 0) {
cerr << "could not get bucket info for bucket=" << bucket_name << ": " << cpp_strerror(-r) << std::endl;
return -r;

View File

@ -169,7 +169,7 @@ int rgw_bucket_sync_user_stats(RGWRados *store, const string& tenant_name, const
{
RGWBucketInfo bucket_info;
RGWSysObjectCtx obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, NULL);
int ret = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, NULL, null_yield);
if (ret < 0) {
ldout(store->ctx(), 0) << "ERROR: could not fetch bucket info: ret=" << ret << dendl;
return ret;
@ -472,7 +472,7 @@ void check_bad_user_bucket_mapping(RGWRados *store, const rgw_user& user_id,
RGWBucketInfo bucket_info;
real_time mtime;
RGWSysObjectCtx obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_info(obj_ctx, user_id.tenant, bucket.name, bucket_info, &mtime);
int r = store->get_bucket_info(obj_ctx, user_id.tenant, bucket.name, bucket_info, &mtime, null_yield);
if (r < 0) {
ldout(store->ctx(), 0) << "could not get bucket info for bucket=" << bucket << dendl;
continue;
@ -529,7 +529,7 @@ int rgw_remove_bucket(RGWRados *store, rgw_bucket& bucket, bool delete_children)
string bucket_ver, master_ver;
ret = store->get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL);
ret = store->get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL, null_yield);
if (ret < 0)
return ret;
@ -635,7 +635,7 @@ int rgw_remove_bucket_bypass_gc(RGWRados *store, rgw_bucket& bucket,
string bucket_ver, master_ver;
ret = store->get_bucket_info(sysobj_ctx, bucket.tenant, bucket.name, info, NULL);
ret = store->get_bucket_info(sysobj_ctx, bucket.tenant, bucket.name, info, NULL, null_yield);
if (ret < 0)
return ret;
@ -796,7 +796,7 @@ int RGWBucket::init(RGWRados *storage, RGWBucketAdminOpState& op_state)
return -EINVAL;
if (!bucket_name.empty()) {
int r = store->get_bucket_info(obj_ctx, tenant, bucket_name, bucket_info, NULL);
int r = store->get_bucket_info(obj_ctx, tenant, bucket_name, bucket_info, NULL, null_yield);
if (r < 0) {
ldout(store->ctx(), 0) << "could not get bucket info for bucket=" << bucket_name << dendl;
return r;
@ -843,7 +843,7 @@ int RGWBucket::link(RGWBucketAdminOpState& op_state, std::string *err_msg)
RGWBucketInfo bucket_info;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, &attrs);
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, &attrs, null_yield);
if (r < 0) {
return r;
}
@ -941,7 +941,7 @@ int RGWBucket::set_quota(RGWBucketAdminOpState& op_state, std::string *err_msg)
RGWBucketInfo bucket_info;
map<string, bufferlist> attrs;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_info(obj_ctx, bucket.tenant, bucket.name, bucket_info, NULL, &attrs);
int r = store->get_bucket_info(obj_ctx, bucket.tenant, bucket.name, bucket_info, NULL, null_yield, &attrs);
if (r < 0) {
set_err_msg(err_msg, "could not get bucket info for bucket=" + bucket.name + ": " + cpp_strerror(-r));
return r;
@ -1051,7 +1051,7 @@ int RGWBucket::check_bad_index_multipart(RGWBucketAdminOpState& op_state,
RGWBucketInfo bucket_info;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, nullptr, nullptr);
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, nullptr, nullptr, null_yield);
if (r < 0) {
ldout(store->ctx(), 0) << "ERROR: " << __func__ << "(): get_bucket_instance_info(bucket=" << bucket << ") returned r=" << r << dendl;
return r;
@ -1242,7 +1242,7 @@ int RGWBucket::get_policy(RGWBucketAdminOpState& op_state, RGWAccessControlPolic
RGWBucketInfo bucket_info;
map<string, bufferlist> attrs;
int ret = store->get_bucket_info(sysobj_ctx, bucket.tenant, bucket.name, bucket_info, NULL, &attrs);
int ret = store->get_bucket_info(sysobj_ctx, bucket.tenant, bucket.name, bucket_info, NULL, null_yield, &attrs);
if (ret < 0) {
return ret;
}
@ -1425,7 +1425,7 @@ static int bucket_stats(RGWRados *store, const std::string& tenant_name, std::st
real_time mtime;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, &mtime);
int r = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, bucket_info, &mtime, null_yield);
if (r < 0)
return r;
@ -1518,7 +1518,7 @@ int RGWBucketAdminOp::limit_check(RGWRados *store,
* the loop body */
ret = store->get_bucket_info(obj_ctx, bucket.tenant, bucket.name,
info, nullptr);
info, nullptr, null_yield);
if (ret < 0)
continue;
@ -1719,7 +1719,7 @@ void get_stale_instances(RGWRados *store, const std::string& bucket_name,
for (const auto& bucket_instance : lst){
RGWBucketInfo binfo;
int r = store->get_bucket_instance_info(obj_ctx, bucket_instance,
binfo, nullptr,nullptr);
binfo, nullptr,nullptr, null_yield);
if (r < 0){
// this can only happen if someone deletes us right when we're processing
lderr(store->ctx()) << "Bucket instance is invalid: " << bucket_instance
@ -1737,7 +1737,7 @@ void get_stale_instances(RGWRados *store, const std::string& bucket_name,
// all the instances
auto [tenant, bucket] = split_tenant(bucket_name);
RGWBucketInfo cur_bucket_info;
int r = store->get_bucket_info(obj_ctx, tenant, bucket, cur_bucket_info, nullptr);
int r = store->get_bucket_info(obj_ctx, tenant, bucket, cur_bucket_info, nullptr, null_yield);
if (r < 0) {
if (r == -ENOENT) {
// bucket doesn't exist, everything is stale then
@ -1887,7 +1887,7 @@ static int fix_single_bucket_lc(RGWRados *store,
RGWBucketInfo bucket_info;
map <std::string, bufferlist> bucket_attrs;
int ret = store->get_bucket_info(obj_ctx, tenant_name, bucket_name,
bucket_info, nullptr, &bucket_attrs);
bucket_info, nullptr, null_yield, &bucket_attrs);
if (ret < 0) {
// TODO: Should we handle the case where the bucket could've been removed between
// listing and fetching?
@ -2756,7 +2756,7 @@ public:
ceph::real_time orig_mtime;
RGWBucketInfo old_bi;
ret = store->get_bucket_instance_info(obj_ctx, be.bucket, old_bi, &orig_mtime, &attrs_m);
ret = store->get_bucket_instance_info(obj_ctx, be.bucket, old_bi, &orig_mtime, &attrs_m, null_yield);
if (ret < 0) {
return ret;
}
@ -2876,7 +2876,7 @@ public:
real_time mtime;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = store->get_bucket_instance_info(obj_ctx, oid, bci.info, &mtime, &bci.attrs);
int ret = store->get_bucket_instance_info(obj_ctx, oid, bci.info, &mtime, &bci.attrs, null_yield);
if (ret < 0)
return ret;
@ -2900,7 +2900,7 @@ public:
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = store->get_bucket_instance_info(obj_ctx, entry, old_bci.info,
&orig_mtime, &old_bci.attrs);
&orig_mtime, &old_bci.attrs, null_yield);
bool exists = (ret != -ENOENT);
if (ret < 0 && exists)
return ret;
@ -2992,7 +2992,7 @@ public:
RGWBucketInfo info;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = store->get_bucket_instance_info(obj_ctx, entry, info, NULL, NULL);
int ret = store->get_bucket_instance_info(obj_ctx, entry, info, NULL, NULL, null_yield);
if (ret < 0 && ret != -ENOENT)
return ret;

View File

@ -529,7 +529,7 @@ bool RGWOmapAppend::finish() {
int RGWAsyncGetBucketInstanceInfo::_send_request()
{
RGWSysObjectCtx obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_instance_from_oid(obj_ctx, oid, bucket_info, NULL, NULL);
int r = store->get_bucket_instance_from_oid(obj_ctx, oid, bucket_info, NULL, NULL, null_yield);
if (r < 0) {
ldout(store->ctx(), 0) << "ERROR: failed to get bucket instance info for "
<< oid << dendl;

View File

@ -95,7 +95,7 @@ int RGWGetBucketInfoCR::Request::_send_request()
{
RGWSysObjectCtx obj_ctx(store->svc.sysobj->init_obj_ctx());
return store->get_bucket_info(obj_ctx, params.tenant, params.bucket_name,
result->bucket_info, &result->mtime, &result->attrs);
result->bucket_info, &result->mtime, null_yield, &result->attrs);
}
template<>
@ -125,7 +125,7 @@ int RGWBucketCreateLocalCR::Request::_send_request()
map<string, bufferlist> bucket_attrs;
int ret = store->get_bucket_info(sysobj_ctx, user.tenant, bucket_name,
bucket_info, nullptr, &bucket_attrs);
bucket_info, nullptr, null_yield, &bucket_attrs);
if (ret < 0 && ret != -ENOENT)
return ret;
bool bucket_exists = (ret != -ENOENT);

View File

@ -949,7 +949,7 @@ int RGWLC::bucket_lc_process(string& shard_id)
string bucket_tenant = result[0];
string bucket_name = result[1];
string bucket_marker = result[2];
int ret = store->get_bucket_info(obj_ctx, bucket_tenant, bucket_name, bucket_info, NULL, &bucket_attrs);
int ret = store->get_bucket_info(obj_ctx, bucket_tenant, bucket_name, bucket_info, NULL, null_yield, &bucket_attrs);
if (ret < 0) {
ldpp_dout(this, 0) << "LC:get_bucket_info for " << bucket_name << " failed" << dendl;
return ret;

View File

@ -364,7 +364,7 @@ int read_history(RGWRados *store, RGWMetadataLogHistory *state,
auto& pool = store->svc.zone->get_zone_params().log_pool;
const auto& oid = RGWMetadataLogHistory::oid;
bufferlist bl;
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, objv_tracker, nullptr);
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, objv_tracker, nullptr, null_yield);
if (ret < 0) {
return ret;
}
@ -806,7 +806,7 @@ int RGWMetadataManager::prepare_mutate(RGWRados *store,
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid,
bl, objv_tracker, &orig_mtime,
nullptr, nullptr);
null_yield, nullptr, nullptr);
if (ret < 0 && ret != -ENOENT) {
return ret;
}

View File

@ -58,7 +58,7 @@ int RGWObjectExpirer::init_bucket_info(const string& tenant_name,
*/
return store->get_bucket_info(obj_ctx, tenant_name, bucket_name,
bucket_info, nullptr, nullptr);
bucket_info, nullptr, null_yield, nullptr);
}

View File

@ -585,9 +585,9 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
RGWBucketInfo source_info;
if (s->bucket_instance_id.empty()) {
ret = store->get_bucket_info(obj_ctx, s->src_tenant_name, s->src_bucket_name, source_info, NULL);
ret = store->get_bucket_info(obj_ctx, s->src_tenant_name, s->src_bucket_name, source_info, NULL, s->yield);
} else {
ret = store->get_bucket_instance_info(obj_ctx, s->bucket_instance_id, source_info, NULL, NULL);
ret = store->get_bucket_instance_info(obj_ctx, s->bucket_instance_id, source_info, NULL, NULL, s->yield);
}
if (ret == 0) {
string& zonegroup = source_info.zonegroup;
@ -608,11 +608,11 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
if (s->bucket_instance_id.empty()) {
ret = store->get_bucket_info(obj_ctx, s->bucket_tenant, s->bucket_name,
s->bucket_info, &s->bucket_mtime,
&s->bucket_attrs);
s->yield, &s->bucket_attrs);
} else {
ret = store->get_bucket_instance_info(obj_ctx, s->bucket_instance_id,
s->bucket_info, &s->bucket_mtime,
&s->bucket_attrs);
&s->bucket_attrs, s->yield);
}
if (ret < 0) {
if (ret != -ENOENT) {
@ -1687,7 +1687,7 @@ int RGWGetObj::handle_user_manifest(const char *prefix)
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_info(obj_ctx, s->user->user_id.tenant,
bucket_name, bucket_info, NULL,
&bucket_attrs);
s->yield, &bucket_attrs);
if (r < 0) {
ldpp_dout(this, 0) << "could not get bucket info for bucket="
<< bucket_name << dendl;
@ -1821,7 +1821,7 @@ int RGWGetObj::handle_slo_manifest(bufferlist& bl)
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_info(obj_ctx, s->user->user_id.tenant,
bucket_name, bucket_info, nullptr,
&bucket_attrs);
s->yield, &bucket_attrs);
if (r < 0) {
ldpp_dout(this, 0) << "could not get bucket info for bucket="
<< bucket_name << dendl;
@ -2983,7 +2983,7 @@ void RGWCreateBucket::execute()
/* we need to make sure we read bucket info, it's not read before for this
* specific request */
op_ret = store->get_bucket_info(*s->sysobj_ctx, s->bucket_tenant, s->bucket_name,
s->bucket_info, nullptr, &s->bucket_attrs);
s->bucket_info, nullptr, s->yield, &s->bucket_attrs);
if (op_ret < 0 && op_ret != -ENOENT)
return;
s->bucket_exists = (op_ret != -ENOENT);
@ -3149,7 +3149,7 @@ void RGWCreateBucket::execute()
map<string, bufferlist> battrs;
op_ret = store->get_bucket_info(*s->sysobj_ctx, s->bucket_tenant, s->bucket_name,
binfo, nullptr, &battrs);
binfo, nullptr, s->yield, &battrs);
if (op_ret < 0) {
return;
} else if (binfo.owner.compare(s->user->user_id) != 0) {
@ -4665,10 +4665,10 @@ int RGWCopyObj::verify_permission()
map<string, bufferlist> src_attrs;
if (s->bucket_instance_id.empty()) {
op_ret = store->get_bucket_info(*s->sysobj_ctx, src_tenant_name, src_bucket_name, src_bucket_info, NULL, &src_attrs);
op_ret = store->get_bucket_info(*s->sysobj_ctx, src_tenant_name, src_bucket_name, src_bucket_info, NULL, s->yield, &src_attrs);
} else {
/* will only happen in intra region sync where the source and dest bucket is the same */
op_ret = store->get_bucket_instance_info(*s->sysobj_ctx, s->bucket_instance_id, src_bucket_info, NULL, &src_attrs);
op_ret = store->get_bucket_instance_info(*s->sysobj_ctx, s->bucket_instance_id, src_bucket_info, NULL, &src_attrs, s->yield);
}
if (op_ret < 0) {
if (op_ret == -ENOENT) {
@ -4736,7 +4736,7 @@ int RGWCopyObj::verify_permission()
dest_attrs = src_attrs;
} else {
op_ret = store->get_bucket_info(*s->sysobj_ctx, dest_tenant_name, dest_bucket_name,
dest_bucket_info, nullptr, &dest_attrs);
dest_bucket_info, nullptr, s->yield, &dest_attrs);
if (op_ret < 0) {
if (op_ret == -ENOENT) {
op_ret = -ERR_NO_SUCH_BUCKET;
@ -6236,7 +6236,7 @@ bool RGWBulkDelete::Deleter::delete_single(const acct_path_t& path)
int ret = store->get_bucket_info(*s->sysobj_ctx, s->user->user_id.tenant,
path.bucket_name, binfo, nullptr,
&battrs);
s->yield, &battrs);
if (ret < 0) {
goto binfo_fail;
}
@ -6521,7 +6521,7 @@ int RGWBulkUploadOp::handle_dir(const boost::string_ref path)
RGWBucketInfo binfo;
std::map<std::string, ceph::bufferlist> battrs;
op_ret = store->get_bucket_info(*dir_ctx, s->bucket_tenant, bucket_name,
binfo, nullptr, &battrs);
binfo, nullptr, s->yield, &battrs);
if (op_ret < 0 && op_ret != -ENOENT) {
return op_ret;
}
@ -6715,7 +6715,7 @@ int RGWBulkUploadOp::handle_file(const boost::string_ref path,
std::map<std::string, ceph::bufferlist> battrs;
ACLOwner bowner;
op_ret = store->get_bucket_info(*s->sysobj_ctx, s->user->user_id.tenant,
bucket_name, binfo, nullptr, &battrs);
bucket_name, binfo, nullptr, s->yield, &battrs);
if (op_ret == -ENOENT) {
ldpp_dout(this, 20) << "non existent directory=" << bucket_name << dendl;
} else if (op_ret < 0) {

View File

@ -501,7 +501,7 @@ int RGWOrphanSearch::build_linked_oids_for_bucket(const string& bucket_instance_
RGWBucketInfo cur_bucket_info;
ret = store->get_bucket_info(sysobj_ctx, orphan_bucket.tenant,
orphan_bucket.name, cur_bucket_info, nullptr);
orphan_bucket.name, cur_bucket_info, nullptr, null_yield);
if (ret < 0) {
if (ret == -ENOENT) {
/* probably raced with bucket removal */
@ -526,7 +526,7 @@ int RGWOrphanSearch::build_linked_oids_for_bucket(const string& bucket_instance_
}
RGWBucketInfo bucket_info;
ret = store->get_bucket_instance_info(sysobj_ctx, bucket_instance_id, bucket_info, nullptr, nullptr);
ret = store->get_bucket_instance_info(sysobj_ctx, bucket_instance_id, bucket_info, nullptr, nullptr, null_yield);
if (ret < 0) {
if (ret == -ENOENT) {
/* probably raced with bucket removal */

View File

@ -515,7 +515,7 @@ int RGWUserPubSub::SubWithEvents<EventType>::list_events(const string& marker, i
RGWBucketInfo bucket_info;
string tenant;
RGWSysObjectCtx obj_ctx(store->svc.sysobj->init_obj_ctx());
ret = store->get_bucket_info(obj_ctx, tenant, sub_conf.dest.bucket_name, bucket_info, nullptr, nullptr);
ret = store->get_bucket_info(obj_ctx, tenant, sub_conf.dest.bucket_name, bucket_info, nullptr, null_yield, nullptr);
if (ret == -ENOENT) {
list.is_truncated = false;
return 0;
@ -581,7 +581,7 @@ int RGWUserPubSub::SubWithEvents<EventType>::remove_event(const string& event_id
RGWBucketInfo bucket_info;
string tenant;
RGWSysObjectCtx sysobj_ctx(store->svc.sysobj->init_obj_ctx());
ret = store->get_bucket_info(sysobj_ctx, tenant, sub_conf.dest.bucket_name, bucket_info, nullptr, nullptr);
ret = store->get_bucket_info(sysobj_ctx, tenant, sub_conf.dest.bucket_name, bucket_info, nullptr, null_yield, nullptr);
if (ret < 0) {
ldout(store->ctx(), 1) << "ERROR: failed to read bucket info for events bucket: bucket=" << sub_conf.dest.bucket_name << " ret=" << ret << dendl;
return ret;

View File

@ -600,7 +600,7 @@ int RGWUserPubSub::read(const rgw_raw_obj& obj, T *result, RGWObjVersionTracker
obj.pool, obj.oid,
bl,
objv_tracker,
nullptr, nullptr, nullptr);
nullptr, null_yield, nullptr, nullptr);
if (ret < 0) {
return ret;
}

View File

@ -296,7 +296,7 @@ int BucketAsyncRefreshHandler::init_fetch()
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL);
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL, null_yield);
if (r < 0) {
ldout(store->ctx(), 0) << "could not get bucket info for bucket=" << bucket << " r=" << r << dendl;
return r;
@ -367,7 +367,7 @@ int RGWBucketStatsCache::fetch_stats_from_storage(const rgw_user& user, const rg
RGWSysObjectCtx obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL);
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL, null_yield);
if (r < 0) {
ldout(store->ctx(), 0) << "could not get bucket info for bucket=" << bucket << " r=" << r << dendl;
return r;
@ -630,7 +630,7 @@ int RGWUserStatsCache::sync_bucket(const rgw_user& user, rgw_bucket& bucket)
RGWSysObjectCtx obj_ctx = store->svc.sysobj->init_obj_ctx();
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL);
int r = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL, null_yield);
if (r < 0) {
ldout(store->ctx(), 0) << "could not get bucket info for bucket=" << bucket << " r=" << r << dendl;
return r;

View File

@ -2369,7 +2369,7 @@ int RGWRados::Bucket::update_bucket_id(const string& new_bucket_id)
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
bucket_info.objv_tracker.clear();
int ret = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, nullptr, nullptr);
int ret = store->get_bucket_instance_info(obj_ctx, bucket, bucket_info, nullptr, nullptr, null_yield);
if (ret < 0) {
return ret;
}
@ -2854,7 +2854,7 @@ int RGWRados::create_bucket(const RGWUserInfo& owner, rgw_bucket& bucket,
RGWObjVersionTracker instance_ver = info.objv_tracker;
info.objv_tracker.clear();
auto obj_ctx = svc.sysobj->init_obj_ctx();
r = get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL, NULL);
r = get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL, null_yield, NULL);
if (r < 0) {
if (r == -ENOENT) {
continue;
@ -3212,7 +3212,7 @@ int RGWRados::BucketShard::init(const rgw_bucket& _bucket,
RGWBucketInfo* bucket_info_p =
bucket_info_out ? bucket_info_out : &bucket_info;
int ret = store->get_bucket_instance_info(obj_ctx, bucket, *bucket_info_p, NULL, NULL);
int ret = store->get_bucket_instance_info(obj_ctx, bucket, *bucket_info_p, NULL, NULL, null_yield);
if (ret < 0) {
return ret;
}
@ -3239,7 +3239,7 @@ int RGWRados::BucketShard::init(const rgw_bucket& _bucket,
RGWBucketInfo bucket_info;
RGWBucketInfo* bucket_info_p =
bucket_info_out ? bucket_info_out : &bucket_info;
int ret = store->get_bucket_instance_info(obj_ctx, bucket, *bucket_info_p, NULL, NULL);
int ret = store->get_bucket_instance_info(obj_ctx, bucket, *bucket_info_p, NULL, NULL, null_yield);
if (ret < 0) {
return ret;
}
@ -3365,7 +3365,7 @@ int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx,
auto sysobj_ctx = svc.sysobj->init_obj_ctx();
r = get_bucket_info(sysobj_ctx, bucket_info.bucket.tenant, bucket_info.swift_ver_location, dest_bucket_info, NULL, NULL);
r = get_bucket_info(sysobj_ctx, bucket_info.bucket.tenant, bucket_info.swift_ver_location, dest_bucket_info, NULL, null_yield, NULL);
if (r < 0) {
ldout(cct, 10) << "failed to read dest bucket info: r=" << r << dendl;
if (r == -ENOENT) {
@ -3442,7 +3442,7 @@ int RGWRados::swift_versioning_restore(RGWSysObjectCtx& sysobj_ctx,
int ret = get_bucket_info(sysobj_ctx, bucket_info.bucket.tenant,
bucket_info.swift_ver_location, archive_binfo,
nullptr, nullptr);
nullptr, null_yield, nullptr);
if (ret < 0) {
return ret;
}
@ -5050,9 +5050,9 @@ int RGWRados::set_bucket_owner(rgw_bucket& bucket, ACLOwner& owner)
auto obj_ctx = svc.sysobj->init_obj_ctx();
int r;
if (bucket.bucket_id.empty()) {
r = get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL, &attrs);
r = get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL, null_yield, &attrs);
} else {
r = get_bucket_instance_info(obj_ctx, bucket, info, nullptr, &attrs);
r = get_bucket_instance_info(obj_ctx, bucket, info, nullptr, &attrs, null_yield);
}
if (r < 0) {
ldout(cct, 0) << "NOTICE: get_bucket_info on bucket=" << bucket.name << " returned err=" << r << dendl;
@ -5087,7 +5087,7 @@ int RGWRados::set_buckets_enabled(vector<rgw_bucket>& buckets, bool enabled)
RGWBucketInfo info;
map<string, bufferlist> attrs;
auto obj_ctx = svc.sysobj->init_obj_ctx();
int r = get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL, &attrs);
int r = get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL, null_yield, &attrs);
if (r < 0) {
ldout(cct, 0) << "NOTICE: get_bucket_info on bucket=" << bucket.name << " returned err=" << r << ", skipping bucket" << dendl;
ret = r;
@ -5113,7 +5113,7 @@ int RGWRados::bucket_suspended(rgw_bucket& bucket, bool *suspended)
{
RGWBucketInfo bucket_info;
auto obj_ctx = svc.sysobj->init_obj_ctx();
int ret = get_bucket_info(obj_ctx, bucket.tenant, bucket.name, bucket_info, NULL);
int ret = get_bucket_info(obj_ctx, bucket.tenant, bucket.name, bucket_info, NULL, null_yield);
if (ret < 0) {
return ret;
}
@ -5634,7 +5634,7 @@ int RGWRados::delete_obj_index(const rgw_obj& obj, ceph::real_time mtime)
auto obj_ctx = svc.sysobj->init_obj_ctx();
RGWBucketInfo bucket_info;
int ret = get_bucket_instance_info(obj_ctx, obj.bucket, bucket_info, NULL, NULL);
int ret = get_bucket_instance_info(obj_ctx, obj.bucket, bucket_info, NULL, NULL, null_yield);
if (ret < 0) {
ldout(cct, 0) << "ERROR: " << __func__ << "() get_bucket_instance_info(bucket=" << obj.bucket << ") returned ret=" << ret << dendl;
return ret;
@ -8113,7 +8113,7 @@ void RGWRados::get_bucket_instance_obj(const rgw_bucket& bucket, rgw_raw_obj& ob
}
int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info,
real_time *pmtime, map<string, bufferlist> *pattrs)
real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y)
{
size_t pos = meta_key.find(':');
if (pos == string::npos) {
@ -8122,11 +8122,11 @@ int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& m
string oid = RGW_BUCKET_INSTANCE_MD_PREFIX + meta_key;
rgw_bucket_instance_key_to_oid(oid);
return get_bucket_instance_from_oid(obj_ctx, oid, info, pmtime, pattrs);
return get_bucket_instance_from_oid(obj_ctx, oid, info, pmtime, pattrs, y);
}
int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info,
real_time *pmtime, map<string, bufferlist> *pattrs)
real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y)
{
string oid;
if (bucket.oid.empty()) {
@ -8135,11 +8135,12 @@ int RGWRados::get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucke
oid = bucket.oid;
}
return get_bucket_instance_from_oid(obj_ctx, oid, info, pmtime, pattrs);
return get_bucket_instance_from_oid(obj_ctx, oid, info, pmtime, pattrs, y);
}
int RGWRados::get_bucket_instance_from_oid(RGWSysObjectCtx& obj_ctx, const string& oid, RGWBucketInfo& info,
real_time *pmtime, map<string, bufferlist> *pattrs,
optional_yield y,
rgw_cache_entry_info *cache_info,
boost::optional<obj_version> refresh_version)
{
@ -8150,7 +8151,7 @@ int RGWRados::get_bucket_instance_from_oid(RGWSysObjectCtx& obj_ctx, const strin
bufferlist epbl;
int ret = rgw_get_system_obj(this, obj_ctx, domain_root,
oid, epbl, &info.objv_tracker, pmtime, pattrs,
oid, epbl, &info.objv_tracker, pmtime, y, pattrs,
cache_info, refresh_version);
if (ret < 0) {
return ret;
@ -8182,7 +8183,7 @@ int RGWRados::get_bucket_entrypoint_info(RGWSysObjectCtx& obj_ctx,
rgw_make_bucket_entry_name(tenant_name, bucket_name, bucket_entry);
int ret = rgw_get_system_obj(this, obj_ctx, svc.zone->get_zone_params().domain_root,
bucket_entry, bl, objv_tracker, pmtime, pattrs,
bucket_entry, bl, objv_tracker, pmtime, null_yield, pattrs,
cache_info, refresh_version);
if (ret < 0) {
return ret;
@ -8242,7 +8243,8 @@ int RGWRados::_get_bucket_info(RGWSysObjectCtx& obj_ctx,
RGWBucketInfo& info,
real_time *pmtime,
map<string, bufferlist> *pattrs,
boost::optional<obj_version> refresh_version)
boost::optional<obj_version> refresh_version,
optional_yield y)
{
string bucket_entry;
rgw_make_bucket_entry_name(tenant, bucket_name, bucket_entry);
@ -8306,7 +8308,7 @@ int RGWRados::_get_bucket_info(RGWSysObjectCtx& obj_ctx,
rgw_cache_entry_info cache_info;
ret = get_bucket_instance_from_oid(obj_ctx, oid, e.info, &e.mtime, &e.attrs,
ret = get_bucket_instance_from_oid(obj_ctx, oid, e.info, &e.mtime, &e.attrs, y,
&cache_info, refresh_version);
e.info.ep_objv = ot.read_version;
info = e.info;
@ -8341,10 +8343,11 @@ int RGWRados::_get_bucket_info(RGWSysObjectCtx& obj_ctx,
int RGWRados::get_bucket_info(RGWSysObjectCtx& obj_ctx,
const string& tenant, const string& bucket_name,
RGWBucketInfo& info,
real_time *pmtime, map<string, bufferlist> *pattrs)
real_time *pmtime,
optional_yield y, map<string, bufferlist> *pattrs)
{
return _get_bucket_info(obj_ctx, tenant, bucket_name, info, pmtime,
pattrs, boost::none);
pattrs, boost::none, y);
}
int RGWRados::try_refresh_bucket_info(RGWBucketInfo& info,
@ -8354,7 +8357,7 @@ int RGWRados::try_refresh_bucket_info(RGWBucketInfo& info,
RGWSysObjectCtx obj_ctx = svc.sysobj->init_obj_ctx();
return _get_bucket_info(obj_ctx, info.bucket.tenant, info.bucket.name,
info, pmtime, pattrs, info.objv_tracker.read_version);
info, pmtime, pattrs, info.objv_tracker.read_version, null_yield);
}
int RGWRados::put_bucket_entrypoint_info(const string& tenant_name, const string& bucket_name, RGWBucketEntryPoint& entry_point,
@ -8441,7 +8444,7 @@ int RGWRados::update_containers_stats(map<string, RGWBucketEnt>& m)
vector<rgw_bucket_dir_header> headers;
RGWBucketInfo bucket_info;
int ret = get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL);
int ret = get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL, null_yield);
if (ret < 0) {
return ret;
}
@ -9695,7 +9698,7 @@ int RGWRados::cls_user_get_bucket_stats(const rgw_bucket& bucket, cls_user_bucke
vector<rgw_bucket_dir_header> headers;
RGWBucketInfo bucket_info;
auto obj_ctx = svc.sysobj->init_obj_ctx();
int ret = get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL);
int ret = get_bucket_instance_info(obj_ctx, bucket, bucket_info, NULL, NULL, null_yield);
if (ret < 0) {
return ret;
}

View File

@ -2136,9 +2136,9 @@ public:
RGWBucketEntryPoint& entry_point, RGWObjVersionTracker *objv_tracker,
ceph::real_time *pmtime, map<string, bufferlist> *pattrs, rgw_cache_entry_info *cache_info = NULL,
boost::optional<obj_version> refresh_version = boost::none);
int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs);
int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs);
int get_bucket_instance_from_oid(RGWSysObjectCtx& obj_ctx, const string& oid, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs,
int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y);
int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y);
int get_bucket_instance_from_oid(RGWSysObjectCtx& obj_ctx, const string& oid, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y,
rgw_cache_entry_info *cache_info = NULL,
boost::optional<obj_version> refresh_version = boost::none);
@ -2151,7 +2151,8 @@ private:
const string& bucket_name, RGWBucketInfo& info,
real_time *pmtime,
map<string, bufferlist> *pattrs,
boost::optional<obj_version> refresh_version);
boost::optional<obj_version> refresh_version,
optional_yield y);
public:
bool call(std::string_view command, const cmdmap_t& cmdmap,
@ -2182,7 +2183,7 @@ public:
int get_bucket_info(RGWSysObjectCtx& obj_ctx,
const string& tenant_name, const string& bucket_name,
RGWBucketInfo& info,
ceph::real_time *pmtime, map<string, bufferlist> *pattrs = NULL);
ceph::real_time *pmtime, optional_yield y, map<string, bufferlist> *pattrs = NULL);
// Returns 0 on successful refresh. Returns error code if there was
// an error or the version stored on the OSD is the same as that

View File

@ -1007,7 +1007,7 @@ int RGWReshard::process_single_logshard(int logshard_num)
map<string, bufferlist> attrs;
ret = store->get_bucket_info(obj_ctx, entry.tenant, entry.bucket_name,
bucket_info, nullptr, &attrs);
bucket_info, nullptr, null_yield, &attrs);
if (ret < 0) {
ldout(cct, 0) << __func__ << ": Error in get_bucket_info: " <<
cpp_strerror(-ret) << dendl;

View File

@ -265,7 +265,7 @@ void RGWOp_Set_Bucket_Quota::execute()
RGWBucketInfo bucket_info;
map<string, bufferlist> attrs;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
http_ret = store->get_bucket_info(obj_ctx, uid.tenant, bucket, bucket_info, NULL, &attrs);
http_ret = store->get_bucket_info(obj_ctx, uid.tenant, bucket, bucket_info, NULL, s->yield, &attrs);
if (http_ret < 0) {
return;
}

View File

@ -392,15 +392,15 @@ void RGWOp_BILog_List::execute() {
}
if (!bucket_instance.empty()) {
http_ret = store->get_bucket_instance_info(*s->sysobj_ctx, bucket_instance, bucket_info, NULL, NULL);
http_ret = store->get_bucket_instance_info(*s->sysobj_ctx, bucket_instance, bucket_info, NULL, NULL, s->yield);
if (http_ret < 0) {
dout(5) << "could not get bucket instance info for bucket instance id=" << bucket_instance << dendl;
ldpp_dout(s, 5) << "could not get bucket instance info for bucket instance id=" << bucket_instance << dendl;
return;
}
} else { /* !bucket_name.empty() */
http_ret = store->get_bucket_info(*s->sysobj_ctx, tenant_name, bucket_name, bucket_info, NULL, NULL);
http_ret = store->get_bucket_info(*s->sysobj_ctx, tenant_name, bucket_name, bucket_info, NULL, s->yield, NULL);
if (http_ret < 0) {
dout(5) << "could not get bucket info for bucket=" << bucket_name << dendl;
ldpp_dout(s, 5) << "could not get bucket info for bucket=" << bucket_name << dendl;
return;
}
}
@ -420,7 +420,7 @@ void RGWOp_BILog_List::execute() {
marker, max_entries - count,
entries, &truncated);
if (ret < 0) {
dout(5) << "ERROR: list_bi_log_entries()" << dendl;
ldpp_dout(s, 5) << "ERROR: list_bi_log_entries()" << dendl;
return;
}
@ -471,7 +471,7 @@ void RGWOp_BILog_Info::execute() {
RGWBucketInfo bucket_info;
if (bucket_name.empty() && bucket_instance.empty()) {
dout(5) << "ERROR: neither bucket nor bucket instance specified" << dendl;
ldpp_dout(s, 5) << "ERROR: neither bucket nor bucket instance specified" << dendl;
http_ret = -EINVAL;
return;
}
@ -483,15 +483,15 @@ void RGWOp_BILog_Info::execute() {
}
if (!bucket_instance.empty()) {
http_ret = store->get_bucket_instance_info(*s->sysobj_ctx, bucket_instance, bucket_info, NULL, NULL);
http_ret = store->get_bucket_instance_info(*s->sysobj_ctx, bucket_instance, bucket_info, NULL, NULL, s->yield);
if (http_ret < 0) {
dout(5) << "could not get bucket instance info for bucket instance id=" << bucket_instance << dendl;
ldpp_dout(s, 5) << "could not get bucket instance info for bucket instance id=" << bucket_instance << dendl;
return;
}
} else { /* !bucket_name.empty() */
http_ret = store->get_bucket_info(*s->sysobj_ctx, tenant_name, bucket_name, bucket_info, NULL, NULL);
http_ret = store->get_bucket_info(*s->sysobj_ctx, tenant_name, bucket_name, bucket_info, NULL, s->yield, NULL);
if (http_ret < 0) {
dout(5) << "could not get bucket info for bucket=" << bucket_name << dendl;
ldpp_dout(s, 5) << "could not get bucket info for bucket=" << bucket_name << dendl;
return;
}
}
@ -533,7 +533,7 @@ void RGWOp_BILog_Delete::execute() {
http_ret = 0;
if ((bucket_name.empty() && bucket_instance.empty()) ||
end_marker.empty()) {
dout(5) << "ERROR: one of bucket and bucket instance, and also end-marker is mandatory" << dendl;
ldpp_dout(s, 5) << "ERROR: one of bucket and bucket instance, and also end-marker is mandatory" << dendl;
http_ret = -EINVAL;
return;
}
@ -545,21 +545,21 @@ void RGWOp_BILog_Delete::execute() {
}
if (!bucket_instance.empty()) {
http_ret = store->get_bucket_instance_info(*s->sysobj_ctx, bucket_instance, bucket_info, NULL, NULL);
http_ret = store->get_bucket_instance_info(*s->sysobj_ctx, bucket_instance, bucket_info, NULL, NULL, s->yield);
if (http_ret < 0) {
dout(5) << "could not get bucket instance info for bucket instance id=" << bucket_instance << dendl;
ldpp_dout(s, 5) << "could not get bucket instance info for bucket instance id=" << bucket_instance << dendl;
return;
}
} else { /* !bucket_name.empty() */
http_ret = store->get_bucket_info(*s->sysobj_ctx, tenant_name, bucket_name, bucket_info, NULL, NULL);
http_ret = store->get_bucket_info(*s->sysobj_ctx, tenant_name, bucket_name, bucket_info, NULL, s->yield, NULL);
if (http_ret < 0) {
dout(5) << "could not get bucket info for bucket=" << bucket_name << dendl;
ldpp_dout(s, 5) << "could not get bucket info for bucket=" << bucket_name << dendl;
return;
}
}
http_ret = store->trim_bi_log_entries(bucket_info, shard_id, start_marker, end_marker);
if (http_ret < 0) {
dout(5) << "ERROR: trim_bi_log_entries() " << dendl;
ldpp_dout(s, 5) << "ERROR: trim_bi_log_entries() " << dendl;
}
return;
}
@ -894,7 +894,7 @@ void RGWOp_BILog_Status::execute()
const auto source_zone = s->info.args.get("source-zone");
const auto key = s->info.args.get("bucket");
if (key.empty()) {
ldout(s->cct, 4) << "no 'bucket' provided" << dendl;
ldpp_dout(s, 4) << "no 'bucket' provided" << dendl;
http_ret = -EINVAL;
return;
}
@ -903,7 +903,7 @@ void RGWOp_BILog_Status::execute()
int shard_id{-1}; // unused
http_ret = rgw_bucket_parse_bucket_key(s->cct, key, &bucket, &shard_id);
if (http_ret < 0) {
ldout(s->cct, 4) << "no 'bucket' provided" << dendl;
ldpp_dout(s, 4) << "no 'bucket' provided" << dendl;
http_ret = -EINVAL;
return;
}
@ -911,9 +911,9 @@ void RGWOp_BILog_Status::execute()
// read the bucket instance info for num_shards
auto ctx = store->svc.sysobj->init_obj_ctx();
RGWBucketInfo info;
http_ret = store->get_bucket_instance_info(ctx, bucket, info, nullptr, nullptr);
http_ret = store->get_bucket_instance_info(ctx, bucket, info, nullptr, nullptr, s->yield);
if (http_ret < 0) {
ldout(s->cct, 4) << "failed to read bucket info: " << cpp_strerror(http_ret) << dendl;
ldpp_dout(s, 4) << "failed to read bucket info: " << cpp_strerror(http_ret) << dendl;
return;
}
http_ret = rgw_bucket_sync_status(this, store, source_zone, info, &status);

View File

@ -1397,7 +1397,7 @@ int RGWPutObj_ObjStore_S3::get_params()
copy_source_tenant_name,
copy_source_bucket_name,
copy_source_bucket_info,
NULL, &src_attrs);
NULL, s->yield, &src_attrs);
if (ret < 0) {
ldpp_dout(this, 5) << __func__ << "(): get_bucket_info() returned ret=" << ret << dendl;
return ret;
@ -3671,7 +3671,7 @@ int RGWHandler_REST_S3Website::retarget(RGWOp* op, RGWOp** new_op) {
int ret = store->get_bucket_info(*s->sysobj_ctx, s->bucket_tenant,
s->bucket_name, s->bucket_info, NULL,
&s->bucket_attrs);
s->yield, &s->bucket_attrs);
if (ret < 0) {
// TODO-FUTURE: if the bucket does not exist, maybe expose it here?
return -ERR_NO_SUCH_BUCKET;

View File

@ -851,7 +851,7 @@ int RGWPutObj_ObjStore_SWIFT::update_slo_segment_size(rgw_slo_entry& entry) {
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
r = store->get_bucket_info(obj_ctx, s->user->user_id.tenant,
bucket_name, bucket_info, nullptr,
&bucket_attrs);
s->yield, &bucket_attrs);
if (r < 0) {
ldpp_dout(this, 0) << "could not get bucket info for bucket="
<< bucket_name << dendl;
@ -2109,7 +2109,7 @@ void RGWFormPost::get_owner_info(const req_state* const s,
RGWBucketInfo bucket_info;
int ret = store->get_bucket_info(*s->sysobj_ctx,
bucket_tenant, bucket_name,
bucket_info, nullptr);
bucket_info, nullptr, s->yield);
if (ret < 0) {
throw ret;
}

View File

@ -305,7 +305,7 @@ int RGWRole::read_id(const string& role_name, const string& tenant, string& role
bufferlist bl;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL, null_yield);
if (ret < 0) {
return ret;
}
@ -331,7 +331,7 @@ int RGWRole::read_info()
bufferlist bl;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL, null_yield);
if (ret < 0) {
ldout(cct, 0) << "ERROR: failed reading role info from pool: " << pool.name <<
": " << id << ": " << cpp_strerror(-ret) << dendl;
@ -358,7 +358,7 @@ int RGWRole::read_name()
bufferlist bl;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL, null_yield);
if (ret < 0) {
ldout(cct, 0) << "ERROR: failed reading role name from pool: " << pool.name << ": "
<< name << ": " << cpp_strerror(-ret) << dendl;

View File

@ -108,7 +108,7 @@ void TempURLEngine::get_owner_info(const DoutPrefixProvider* dpp, const req_stat
RGWBucketInfo bucket_info;
int ret = store->get_bucket_info(*s->sysobj_ctx,
bucket_tenant, bucket_name,
bucket_info, nullptr);
bucket_info, nullptr, null_yield);
if (ret < 0) {
throw ret;
}

View File

@ -700,7 +700,7 @@ public:
const auto& id = s->owner.get_id();
ret = store->get_bucket_info(*s->sysobj_ctx, id.tenant, bucket_name,
bucket_info, nullptr, nullptr);
bucket_info, nullptr, null_yield, nullptr);
if (ret < 0) {
ldout(s->cct, 1) << "failed to get bucket info, cannot verify ownership" << dendl;
return ret;
@ -963,7 +963,7 @@ public:
}
ret = store->get_bucket_info(*s->sysobj_ctx, s->owner.get_id().tenant, bucket_name,
bucket_info, nullptr, nullptr);
bucket_info, nullptr, null_yield, nullptr);
if (ret < 0) {
return ret;
}
@ -1123,7 +1123,7 @@ public:
}
ret = store->get_bucket_info(*s->sysobj_ctx, s->owner.get_id().tenant, bucket_name,
bucket_info, nullptr, nullptr);
bucket_info, nullptr, null_yield, nullptr);
if (ret < 0) {
return ret;
}

View File

@ -130,7 +130,7 @@ int rgw_put_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& o
}
int rgw_get_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& key, bufferlist& bl,
RGWObjVersionTracker *objv_tracker, real_time *pmtime, map<string, bufferlist> *pattrs,
RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, map<string, bufferlist> *pattrs,
rgw_cache_entry_info *cache_info, boost::optional<obj_version> refresh_version)
{
bufferlist::iterator iter;
@ -149,13 +149,13 @@ int rgw_get_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_p
int ret = rop.set_attrs(pattrs)
.set_last_mod(pmtime)
.set_objv_tracker(objv_tracker)
.stat(null_yield);
.stat(y);
if (ret < 0)
return ret;
ret = rop.set_cache_info(cache_info)
.set_refresh_version(refresh_version)
.read(&bl, null_yield);
.read(&bl, y);
if (ret == -ECANCELED) {
/* raced, restart */
if (!original_readv.empty()) {
@ -394,6 +394,7 @@ int RGWDataAccess::Bucket::init()
tenant, name,
bucket_info,
&mtime,
null_yield,
&attrs);
if (ret < 0) {
return ret;

View File

@ -25,7 +25,7 @@ int rgw_init_ioctx(librados::Rados *rados, const rgw_pool& pool,
int rgw_put_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive,
RGWObjVersionTracker *objv_tracker, real_time set_mtime, map<string, bufferlist> *pattrs = NULL);
int rgw_get_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& key, bufferlist& bl,
RGWObjVersionTracker *objv_tracker, real_time *pmtime, map<string, bufferlist> *pattrs = NULL,
RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, map<string, bufferlist> *pattrs = NULL,
rgw_cache_entry_info *cache_info = NULL,
boost::optional<obj_version> refresh_version = boost::none);
int rgw_delete_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& oid,

View File

@ -73,7 +73,7 @@ int rgw_user_sync_all_stats(RGWRados *store, const rgw_user& user_id)
RGWBucketInfo bucket_info;
ret = store->get_bucket_info(obj_ctx, user_id.tenant, bucket_ent.bucket.name,
bucket_info, nullptr, nullptr);
bucket_info, nullptr, null_yield, nullptr);
if (ret < 0) {
ldout(cct, 0) << "ERROR: could not read bucket info: bucket=" << bucket_ent.bucket << " ret=" << ret << dendl;
continue;
@ -280,7 +280,7 @@ int rgw_get_user_info_from_index(RGWRados * const store,
RGWUID uid;
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
int ret = rgw_get_system_obj(store, obj_ctx, pool, key, bl, NULL, &e.mtime);
int ret = rgw_get_system_obj(store, obj_ctx, pool, key, bl, NULL, &e.mtime, null_yield);
if (ret < 0)
return ret;
@ -326,7 +326,7 @@ int rgw_get_user_info_by_uid(RGWRados *store,
auto obj_ctx = store->svc.sysobj->init_obj_ctx();
string oid = uid.to_str();
int ret = rgw_get_system_obj(store, obj_ctx, store->svc.zone->get_zone_params().user_uid_pool, oid, bl, objv_tracker, pmtime, pattrs, cache_info);
int ret = rgw_get_system_obj(store, obj_ctx, store->svc.zone->get_zone_params().user_uid_pool, oid, bl, objv_tracker, pmtime, null_yield, pattrs, cache_info);
if (ret < 0) {
return ret;
}