From: Adam C. Emerson Date: Wed, 11 Nov 2020 22:12:08 +0000 (-0500) Subject: rgw: No null_yield in rgw_rest X-Git-Tag: v16.1.0~608^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38082%2Fhead;p=ceph.git rgw: No null_yield in rgw_rest Signed-off-by: Adam C. Emerson --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index a42cb6b4485..c85bf856404 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1581,7 +1581,7 @@ static int send_to_remote_gateway(RGWRESTConn* conn, req_info& info, ceph::bufferlist response; rgw_user user; - int ret = conn->forward(user, info, nullptr, MAX_REST_RESPONSE, &in_data, &response); + int ret = conn->forward(user, info, nullptr, MAX_REST_RESPONSE, &in_data, &response, null_yield); int parse_ret = parser.parse(response.c_str(), response.length()); if (parse_ret < 0) { @@ -1607,7 +1607,7 @@ static int send_to_url(const string& url, const string& access, RGWRESTSimpleRequest req(g_ceph_context, info.method, url, NULL, ¶ms); bufferlist response; - int ret = req.forward_request(key, info, MAX_REST_RESPONSE, &in_data, &response); + int ret = req.forward_request(key, info, MAX_REST_RESPONSE, &in_data, &response, null_yield); int parse_ret = parser.parse(response.c_str(), response.length()); if (parse_ret < 0) { diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 33909d8fc20..b7765c9deae 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1133,7 +1133,7 @@ void RGWPutBucketTags::execute(optional_yield y) if (op_ret < 0) return; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; } @@ -1159,7 +1159,7 @@ int RGWDeleteBucketTags::verify_permission(optional_yield y) void RGWDeleteBucketTags::execute(optional_yield y) { bufferlist in_data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -1207,7 +1207,7 @@ void RGWPutBucketReplication::execute(optional_yield y) { if (op_ret < 0) return; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -1245,7 +1245,7 @@ int RGWDeleteBucketReplication::verify_permission(optional_yield y) void RGWDeleteBucketReplication::execute(optional_yield y) { bufferlist in_data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -2591,7 +2591,7 @@ void RGWSetBucketVersioning::execute(optional_yield y) } } - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -2667,7 +2667,7 @@ void RGWSetBucketWebsite::execute(optional_yield y) if (op_ret < 0) return; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << " forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -2701,7 +2701,7 @@ void RGWDeleteBucketWebsite::execute(optional_yield y) { bufferlist in_data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "NOTICE: forward_to_master failed on bucket=" << s->bucket->get_name() << "returned err=" << op_ret << dendl; @@ -3333,7 +3333,7 @@ void RGWDeleteBucket::execute(optional_yield y) } bufferlist in_data; - op_ret = store->forward_request_to_master(s->user.get(), &ot.read_version, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), &ot.read_version, in_data, nullptr, s->info, y); if (op_ret < 0) { if (op_ret == -ENOENT) { /* adjust error, we want to return with NoSuchBucket and not @@ -5442,7 +5442,7 @@ void RGWPutACLs::execute(optional_yield y) if (s->canned_acl.empty()) { in_data.append(data); } - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -5569,7 +5569,7 @@ void RGWPutLC::execute(optional_yield y) ldpp_dout(this, 15) << "New LifecycleConfiguration:" << ss.str() << dendl; } - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -5585,7 +5585,7 @@ void RGWPutLC::execute(optional_yield y) void RGWDeleteLC::execute(optional_yield y) { bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -5629,7 +5629,7 @@ void RGWPutCORS::execute(optional_yield y) if (op_ret < 0) return; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -5651,7 +5651,7 @@ int RGWDeleteCORS::verify_permission(optional_yield y) void RGWDeleteCORS::execute(optional_yield y) { bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -5761,7 +5761,7 @@ void RGWSetRequestPayment::pre_exec() void RGWSetRequestPayment::execute(optional_yield y) { - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -7534,7 +7534,7 @@ void RGWPutBucketPolicy::execute(optional_yield y) return; } - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 20) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -7678,7 +7678,7 @@ void RGWPutBucketObjectLock::execute(optional_yield y) return; } - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldout(s->cct, 20) << __func__ << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -7997,7 +7997,7 @@ void RGWPutBucketPublicAccessBlock::execute(optional_yield y) return; } - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; diff --git a/src/rgw/rgw_period_puller.cc b/src/rgw/rgw_period_puller.cc index ebc4a0dc09b..7f870cbab05 100644 --- a/src/rgw/rgw_period_puller.cc +++ b/src/rgw/rgw_period_puller.cc @@ -25,7 +25,8 @@ namespace { // pull the given period over the connection int pull_period(RGWRESTConn* conn, const std::string& period_id, - const std::string& realm_id, RGWPeriod& period) + const std::string& realm_id, RGWPeriod& period, + optional_yield y) { rgw_user user; RGWEnv env; @@ -39,7 +40,7 @@ int pull_period(RGWRESTConn* conn, const std::string& period_id, bufferlist data; #define MAX_REST_RESPONSE (128 * 1024) - int r = conn->forward(user, info, nullptr, MAX_REST_RESPONSE, nullptr, &data); + int r = conn->forward(user, info, nullptr, MAX_REST_RESPONSE, nullptr, &data, y); if (r < 0) { return r; } @@ -81,7 +82,7 @@ int RGWPeriodPuller::pull(const std::string& period_id, RGWPeriod& period, << " from master" << dendl; // request the period from the master zone r = pull_period(svc.zone->get_master_conn(), period_id, - svc.zone->get_realm().get_id(), period); + svc.zone->get_realm().get_id(), period, y); if (r < 0) { lderr(cct) << "failed to pull period " << period_id << dendl; return r; diff --git a/src/rgw/rgw_rest_bucket.cc b/src/rgw/rgw_rest_bucket.cc index a007e3be8a6..3a07cebf0a6 100644 --- a/src/rgw/rgw_rest_bucket.cc +++ b/src/rgw/rgw_rest_bucket.cc @@ -150,7 +150,7 @@ void RGWOp_Bucket_Link::execute(optional_yield y) op_state.set_new_bucket_name(new_bucket_name); bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -188,7 +188,7 @@ void RGWOp_Bucket_Unlink::execute(optional_yield y) op_state.set_bucket_name(bucket); bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; diff --git a/src/rgw/rgw_rest_client.cc b/src/rgw/rgw_rest_client.cc index 55236a79b59..eb38b15eda4 100644 --- a/src/rgw/rgw_rest_client.cc +++ b/src/rgw/rgw_rest_client.cc @@ -116,7 +116,7 @@ static void get_gmt_date_str(string& date_str) date_str = buffer; } -int RGWRESTSimpleRequest::execute(RGWAccessKey& key, const char *_method, const char *resource) +int RGWRESTSimpleRequest::execute(RGWAccessKey& key, const char *_method, const char *resource, optional_yield y) { method = _method; string new_url = url; @@ -155,7 +155,7 @@ int RGWRESTSimpleRequest::execute(RGWAccessKey& key, const char *_method, const ldout(cct, 15) << "generated auth header: " << auth_hdr << dendl; headers.push_back(pair("AUTHORIZATION", auth_hdr)); - int r = process(null_yield); + int r = process(y); if (r < 0) return r; @@ -269,7 +269,7 @@ static int sign_request(CephContext *cct, RGWAccessKey& key, RGWEnv& env, req_in return 0; } -int RGWRESTSimpleRequest::forward_request(RGWAccessKey& key, req_info& info, size_t max_response, bufferlist *inbl, bufferlist *outbl) +int RGWRESTSimpleRequest::forward_request(RGWAccessKey& key, req_info& info, size_t max_response, bufferlist *inbl, bufferlist *outbl, optional_yield y) { string date_str; @@ -331,7 +331,7 @@ int RGWRESTSimpleRequest::forward_request(RGWAccessKey& key, req_info& info, siz method = new_info.method; url = new_url; - int r = process(null_yield); + int r = process(y); if (r < 0){ if (r == -EINVAL){ // curl_easy has errored, generally means the service is not available diff --git a/src/rgw/rgw_rest_client.h b/src/rgw/rgw_rest_client.h index 31b7978f18d..c065dc0248a 100644 --- a/src/rgw/rgw_rest_client.h +++ b/src/rgw/rgw_rest_client.h @@ -63,8 +63,8 @@ public: RGWRESTSimpleRequest(CephContext *_cct, const string& _method, const string& _url, param_vec_t *_headers, param_vec_t *_params) : RGWHTTPSimpleRequest(_cct, _method, _url, _headers, _params) {} - int execute(RGWAccessKey& key, const char *method, const char *resource); - int forward_request(RGWAccessKey& key, req_info& info, size_t max_response, bufferlist *inbl, bufferlist *outbl); + int execute(RGWAccessKey& key, const char *method, const char *resource, optional_yield y); + int forward_request(RGWAccessKey& key, req_info& info, size_t max_response, bufferlist *inbl, bufferlist *outbl, optional_yield y); }; class RGWWriteDrainCB { diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc index ae976283c46..3ee9183944c 100644 --- a/src/rgw/rgw_rest_conn.cc +++ b/src/rgw/rgw_rest_conn.cc @@ -86,7 +86,7 @@ void RGWRESTConn::populate_params(param_vec_t& params, const rgw_user *uid, cons populate_zonegroup(params, zonegroup); } -int RGWRESTConn::forward(const rgw_user& uid, req_info& info, obj_version *objv, size_t max_response, bufferlist *inbl, bufferlist *outbl) +int RGWRESTConn::forward(const rgw_user& uid, req_info& info, obj_version *objv, size_t max_response, bufferlist *inbl, bufferlist *outbl, optional_yield y) { string url; int ret = get_url(url); @@ -101,7 +101,7 @@ int RGWRESTConn::forward(const rgw_user& uid, req_info& info, obj_version *objv, params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "ver", buf)); } RGWRESTSimpleRequest req(cct, info.method, url, NULL, ¶ms); - return req.forward_request(key, info, max_response, inbl, outbl); + return req.forward_request(key, info, max_response, inbl, outbl, y); } class StreamObjData : public RGWGetDataCB { @@ -155,7 +155,7 @@ int RGWRESTConn::put_obj_async(const rgw_user& uid, rgw::sal::RGWObject* obj, ui int RGWRESTConn::complete_request(RGWRESTStreamS3PutObj *req, string& etag, real_time *mtime, optional_yield y) { - int ret = req->complete_request(null_yield, &etag, mtime); + int ret = req->complete_request(y, &etag, mtime); delete req; return ret; @@ -376,7 +376,7 @@ void RGWRESTReadResource::init_common(param_vec_t *extra_headers) req.set_params(¶ms); } -int RGWRESTReadResource::read() +int RGWRESTReadResource::read(optional_yield y) { int ret = req.send_request(&conn->get_key(), headers, resource, mgr); if (ret < 0) { @@ -384,7 +384,7 @@ int RGWRESTReadResource::read() return ret; } - return req.complete_request(null_yield); + return req.complete_request(y); } int RGWRESTReadResource::aio_read() @@ -434,7 +434,7 @@ void RGWRESTSendResource::init_common(param_vec_t *extra_headers) req.set_params(¶ms); } -int RGWRESTSendResource::send(bufferlist& outbl) +int RGWRESTSendResource::send(bufferlist& outbl, optional_yield y) { req.set_send_length(outbl.length()); req.set_outbl(outbl); @@ -445,7 +445,7 @@ int RGWRESTSendResource::send(bufferlist& outbl) return ret; } - return req.complete_request(null_yield); + return req.complete_request(y); } int RGWRESTSendResource::aio_send(bufferlist& outbl) diff --git a/src/rgw/rgw_rest_conn.h b/src/rgw/rgw_rest_conn.h index f1a947d7d00..b4fac21391b 100644 --- a/src/rgw/rgw_rest_conn.h +++ b/src/rgw/rgw_rest_conn.h @@ -108,7 +108,7 @@ public: virtual void populate_params(param_vec_t& params, const rgw_user *uid, const string& zonegroup); /* sync request */ - int forward(const rgw_user& uid, req_info& info, obj_version *objv, size_t max_response, bufferlist *inbl, bufferlist *outbl); + int forward(const rgw_user& uid, req_info& info, obj_version *objv, size_t max_response, bufferlist *inbl, bufferlist *outbl, optional_yield y); /* async requests */ @@ -296,7 +296,7 @@ public: template int decode_resource(T *dest); - int read(); + int read(optional_yield y); int aio_read(); @@ -325,7 +325,7 @@ public: int wait(T *dest, optional_yield y); template - int fetch(T *dest); + int fetch(T *dest, optional_yield y); }; @@ -344,9 +344,9 @@ int RGWRESTReadResource::decode_resource(T *dest) } template -int RGWRESTReadResource::fetch(T *dest) +int RGWRESTReadResource::fetch(T *dest, optional_yield y) { - int ret = read(); + int ret = read(y); if (ret < 0) { return ret; } @@ -417,7 +417,7 @@ public: return req.get_io_user_info(); } - int send(bufferlist& bl); + int send(bufferlist& bl, optional_yield y); int aio_send(bufferlist& bl); diff --git a/src/rgw/rgw_rest_sts.cc b/src/rgw/rgw_rest_sts.cc index 75a808aa8c9..edc3459055a 100644 --- a/src/rgw/rgw_rest_sts.cc +++ b/src/rgw/rgw_rest_sts.cc @@ -132,7 +132,8 @@ WebTokenEngine::is_cert_valid(const vector& thumbprints, const string& c //Offline validation of incoming Web Token which is a signed JWT (JSON Web Token) boost::optional -WebTokenEngine::get_from_jwt(const DoutPrefixProvider* dpp, const std::string& token, const req_state* const s) const +WebTokenEngine::get_from_jwt(const DoutPrefixProvider* dpp, const std::string& token, const req_state* const s, + optional_yield y) const { WebTokenEngine::token_t t; try { @@ -174,7 +175,7 @@ WebTokenEngine::get_from_jwt(const DoutPrefixProvider* dpp, const std::string& t if (decoded.has_algorithm()) { auto& algorithm = decoded.get_algorithm(); try { - validate_signature(dpp, decoded, algorithm, t.iss, thumbprints, null_yield); + validate_signature(dpp, decoded, algorithm, t.iss, thumbprints, y); } catch (...) { throw -EACCES; } @@ -334,7 +335,7 @@ WebTokenEngine::authenticate( const DoutPrefixProvider* dpp, } try { - t = get_from_jwt(dpp, token, s); + t = get_from_jwt(dpp, token, s, y); } catch (...) { return result_t::deny(-EACCES); diff --git a/src/rgw/rgw_rest_sts.h b/src/rgw/rgw_rest_sts.h index 45c9ed000bc..5ef1fa82adc 100644 --- a/src/rgw/rgw_rest_sts.h +++ b/src/rgw/rgw_rest_sts.h @@ -34,7 +34,7 @@ class WebTokenEngine : public rgw::auth::Engine { std::string get_role_tenant(const string& role_arn) const; boost::optional - get_from_jwt(const DoutPrefixProvider* dpp, const std::string& token, const req_state* const s) const; + get_from_jwt(const DoutPrefixProvider* dpp, const std::string& token, const req_state* const s, optional_yield y) const; void validate_signature (const DoutPrefixProvider* dpp, const jwt::decoded_jwt& decoded, const string& algorithm, const string& iss, const vector& thumbprints, optional_yield y) const; diff --git a/src/rgw/rgw_rest_user.cc b/src/rgw/rgw_rest_user.cc index 2d3e8e9d821..06fd022f115 100644 --- a/src/rgw/rgw_rest_user.cc +++ b/src/rgw/rgw_rest_user.cc @@ -225,7 +225,7 @@ void RGWOp_User_Create::execute(optional_yield y) } bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -367,7 +367,7 @@ void RGWOp_User_Modify::execute(optional_yield y) } bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -408,7 +408,7 @@ void RGWOp_User_Remove::execute(optional_yield y) op_state.set_purge_data(purge_data); bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -484,7 +484,7 @@ void RGWOp_Subuser_Create::execute(optional_yield y) op_state.set_key_type(key_type); bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -551,7 +551,7 @@ void RGWOp_Subuser_Modify::execute(optional_yield y) op_state.set_key_type(key_type); bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -594,7 +594,7 @@ void RGWOp_Subuser_Remove::execute(optional_yield y) op_state.set_purge_keys(); bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -735,7 +735,7 @@ void RGWOp_Caps_Add::execute(optional_yield y) op_state.set_caps(caps); bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -773,7 +773,7 @@ void RGWOp_Caps_Remove::execute(optional_yield y) op_state.set_caps(caps); bufferlist data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl; return; diff --git a/src/rgw/rgw_rest_user_policy.cc b/src/rgw/rgw_rest_user_policy.cc index 953220c04e2..7c8429bdcb2 100644 --- a/src/rgw/rgw_rest_user_policy.cc +++ b/src/rgw/rgw_rest_user_policy.cc @@ -134,7 +134,7 @@ void RGWPutUserPolicy::execute(optional_yield y) } ceph::bufferlist in_data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { ldpp_dout(this, 0) << "ERROR: forward_request_to_master returned ret=" << op_ret << dendl; return; @@ -338,7 +338,7 @@ void RGWDeleteUserPolicy::execute(optional_yield y) } ceph::bufferlist in_data; - op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info); + op_ret = store->forward_request_to_master(s->user.get(), nullptr, in_data, nullptr, s->info, y); if (op_ret < 0) { // a policy might've been uploaded to this site when there was no sync // req. in earlier releases, proceed deletion diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index a7e10c79efa..f21ca91036f 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -74,7 +74,8 @@ class RGWStore : public DoutPrefixProvider { virtual RGWBucketList* list_buckets(void) = 0; virtual bool is_meta_master() = 0; virtual int forward_request_to_master(RGWUser* user, obj_version *objv, - bufferlist& in_data, JSONParser *jp, req_info& info) = 0; + bufferlist& in_data, JSONParser *jp, req_info& info, + optional_yield y) = 0; virtual int defer_gc(RGWObjectCtx *rctx, RGWBucket* bucket, RGWObject* obj, optional_yield y) = 0; virtual const RGWZoneGroup& get_zonegroup() = 0; diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index a1757cf5fe1..6ae2f3edd44 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -153,7 +153,7 @@ int RGWRadosBucket::remove_bucket(bool delete_children, std::string prefix, std: if (forward_to_master) { bufferlist in_data; - ret = store->forward_request_to_master(owner, &ot.read_version, in_data, nullptr, *req_info); + ret = store->forward_request_to_master(owner, &ot.read_version, in_data, nullptr, *req_info, y); if (ret < 0) { if (ret == -ENOENT) { /* adjust error, we want to return with NoSuchBucket and not @@ -782,7 +782,8 @@ bool RGWRadosStore::is_meta_master() int RGWRadosStore::forward_request_to_master(RGWUser* user, obj_version *objv, bufferlist& in_data, - JSONParser *jp, req_info& info) + JSONParser *jp, req_info& info, + optional_yield y) { if (is_meta_master()) { /* We're master, don't forward */ @@ -799,7 +800,7 @@ int RGWRadosStore::forward_request_to_master(RGWUser* user, obj_version *objv, #define MAX_REST_RESPONSE (128 * 1024) // we expect a very small response int ret = svc()->zone->get_master_conn()->forward(rgw_user(uid_str), info, objv, MAX_REST_RESPONSE, - &in_data, &response); + &in_data, &response, y); if (ret < 0) return ret; @@ -880,7 +881,7 @@ int RGWRadosStore::create_bucket(RGWUser& u, const rgw_bucket& b, if (!svc()->zone->is_meta_master()) { JSONParser jp; - ret = forward_request_to_master(&u, NULL, in_data, &jp, req_info); + ret = forward_request_to_master(&u, NULL, in_data, &jp, req_info, y); if (ret < 0) { return ret; } diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index bd705e7b0fd..bb0acd167bd 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -253,7 +253,8 @@ class RGWRadosStore : public RGWStore { virtual RGWBucketList* list_buckets(void) { return new RGWBucketList(); } virtual bool is_meta_master() override; virtual int forward_request_to_master(RGWUser* user, obj_version *objv, - bufferlist& in_data, JSONParser *jp, req_info& info) override; + bufferlist& in_data, JSONParser *jp, req_info& info, + optional_yield y) override; virtual int defer_gc(RGWObjectCtx *rctx, RGWBucket* bucket, RGWObject* obj, optional_yield y) override; virtual const RGWZoneGroup& get_zonegroup() override;