diff options
author | Casey Bodley <cbodley@redhat.com> | 2023-03-18 22:51:25 +0100 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2023-11-07 18:18:17 +0100 |
commit | e93b6bb956829785b1e9daddc1679882d6e5901f (patch) | |
tree | 453264420dce9fba65423118be24b303911e6a2e /src/rgw | |
parent | rgw: add free function forward_iam_request_to_master() (diff) | |
download | ceph-e93b6bb956829785b1e9daddc1679882d6e5901f.tar.xz ceph-e93b6bb956829785b1e9daddc1679882d6e5901f.zip |
rgw/sal: remove forward-to-master functions from Driver
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw')
-rw-r--r-- | src/rgw/driver/daos/rgw_sal_daos.cc | 16 | ||||
-rw-r--r-- | src/rgw/driver/daos/rgw_sal_daos.h | 9 | ||||
-rw-r--r-- | src/rgw/driver/motr/rgw_sal_motr.cc | 16 | ||||
-rw-r--r-- | src/rgw/driver/motr/rgw_sal_motr.h | 7 | ||||
-rw-r--r-- | src/rgw/driver/rados/rgw_sal_rados.cc | 72 | ||||
-rw-r--r-- | src/rgw/driver/rados/rgw_sal_rados.h | 7 | ||||
-rw-r--r-- | src/rgw/rgw_sal.h | 8 | ||||
-rw-r--r-- | src/rgw/rgw_sal_dbstore.cc | 16 | ||||
-rw-r--r-- | src/rgw/rgw_sal_dbstore.h | 7 | ||||
-rw-r--r-- | src/rgw/rgw_sal_filter.cc | 20 | ||||
-rw-r--r-- | src/rgw/rgw_sal_filter.h | 11 |
11 files changed, 0 insertions, 189 deletions
diff --git a/src/rgw/driver/daos/rgw_sal_daos.cc b/src/rgw/driver/daos/rgw_sal_daos.cc index 8be268fe17c..1bade375203 100644 --- a/src/rgw/driver/daos/rgw_sal_daos.cc +++ b/src/rgw/driver/daos/rgw_sal_daos.cc @@ -2252,22 +2252,6 @@ int DaosStore::load_bucket(const DoutPrefixProvider* dpp, User* u, bool DaosStore::is_meta_master() { return true; } -int DaosStore::forward_request_to_master(const DoutPrefixProvider* dpp, - User* user, obj_version* objv, - bufferlist& in_data, JSONParser* jp, - req_info& info, optional_yield y) { - return DAOS_NOT_IMPLEMENTED_LOG(dpp); -} - -int DaosStore::forward_iam_request_to_master(const DoutPrefixProvider* dpp, - const RGWAccessKey& key, - obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, - req_info& info, optional_yield y) { - return DAOS_NOT_IMPLEMENTED_LOG(dpp); -} - std::string DaosStore::zone_unique_id(uint64_t unique_num) { return ""; } std::string DaosStore::zone_unique_trans_id(const uint64_t unique_num) { diff --git a/src/rgw/driver/daos/rgw_sal_daos.h b/src/rgw/driver/daos/rgw_sal_daos.h index 4d5e6c83107..8394fb2f757 100644 --- a/src/rgw/driver/daos/rgw_sal_daos.h +++ b/src/rgw/driver/daos/rgw_sal_daos.h @@ -898,15 +898,6 @@ class DaosStore : public StoreDriver { const rgw_bucket& b, std::unique_ptr<Bucket>* bucket, optional_yield y) override; virtual bool is_meta_master() override; - virtual int forward_request_to_master(const DoutPrefixProvider* dpp, - User* user, obj_version* objv, - bufferlist& in_data, JSONParser* jp, - req_info& info, - optional_yield y) override; - virtual int forward_iam_request_to_master( - const DoutPrefixProvider* dpp, const RGWAccessKey& key, obj_version* objv, - bufferlist& in_data, RGWXMLDecoder::XMLParser* parser, req_info& info, - optional_yield y) override; virtual Zone* get_zone() { return &zone; } virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; diff --git a/src/rgw/driver/motr/rgw_sal_motr.cc b/src/rgw/driver/motr/rgw_sal_motr.cc index d6a5eb1bc3e..1e110ae73a3 100644 --- a/src/rgw/driver/motr/rgw_sal_motr.cc +++ b/src/rgw/driver/motr/rgw_sal_motr.cc @@ -3246,22 +3246,6 @@ bool MotrStore::is_meta_master() return true; } -int MotrStore::forward_request_to_master(const DoutPrefixProvider *dpp, User* user, obj_version *objv, - bufferlist& in_data, - JSONParser *jp, req_info& info, - optional_yield y) -{ - return 0; -} - -int MotrStore::forward_iam_request_to_master(const DoutPrefixProvider *dpp, const RGWAccessKey& key, obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, req_info& info, - optional_yield y) -{ - return 0; -} - std::string MotrStore::zone_unique_id(uint64_t unique_num) { return ""; diff --git a/src/rgw/driver/motr/rgw_sal_motr.h b/src/rgw/driver/motr/rgw_sal_motr.h index 66ca8314fc0..92ddc9a115f 100644 --- a/src/rgw/driver/motr/rgw_sal_motr.h +++ b/src/rgw/driver/motr/rgw_sal_motr.h @@ -994,13 +994,6 @@ class MotrStore : public StoreDriver { int load_bucket(const DoutPrefixProvider *dpp, User* u, const rgw_bucket& b, std::unique_ptr<Bucket>* bucket, optional_yield y) override; virtual bool is_meta_master() override; - virtual int forward_request_to_master(const DoutPrefixProvider *dpp, User* user, obj_version* objv, - bufferlist& in_data, JSONParser *jp, req_info& info, - optional_yield y) override; - virtual int forward_iam_request_to_master(const DoutPrefixProvider *dpp, const RGWAccessKey& key, obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, req_info& info, - optional_yield y) override; virtual Zone* get_zone() { return &zone; } virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; diff --git a/src/rgw/driver/rados/rgw_sal_rados.cc b/src/rgw/driver/rados/rgw_sal_rados.cc index 68b6d998eca..f96378ada01 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.cc +++ b/src/rgw/driver/rados/rgw_sal_rados.cc @@ -1005,78 +1005,6 @@ bool RadosStore::is_meta_master() return svc()->zone->is_meta_master(); } -int RadosStore::forward_request_to_master(const DoutPrefixProvider *dpp, User* user, obj_version* objv, - bufferlist& in_data, - JSONParser* jp, req_info& info, - optional_yield y) -{ - if (is_meta_master()) { - /* We're master, don't forward */ - return 0; - } - - if (!svc()->zone->get_master_conn()) { - ldpp_dout(dpp, 0) << "rest connection is invalid" << dendl; - return -EINVAL; - } - ldpp_dout(dpp, 0) << "sending request to master zonegroup" << dendl; - bufferlist response; - std::string uid_str = user->get_id().to_str(); -#define MAX_REST_RESPONSE (128 * 1024) // we expect a very small response - int ret = svc()->zone->get_master_conn()->forward(dpp, rgw_user(uid_str), info, - objv, MAX_REST_RESPONSE, - &in_data, &response, y); - if (ret < 0) - return ret; - - ldpp_dout(dpp, 20) << "response: " << response.c_str() << dendl; - if (jp && !jp->parse(response.c_str(), response.length())) { - ldpp_dout(dpp, 0) << "failed parsing response from master zonegroup" << dendl; - return -EINVAL; - } - - return 0; -} - -int RadosStore::forward_iam_request_to_master(const DoutPrefixProvider *dpp, const RGWAccessKey& key, obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, req_info& info, - optional_yield y) -{ - if (is_meta_master()) { - /* We're master, don't forward */ - return 0; - } - - if (!svc()->zone->get_master_conn()) { - ldpp_dout(dpp, 0) << "rest connection is invalid" << dendl; - return -EINVAL; - } - ldpp_dout(dpp, 0) << "sending request to master zonegroup" << dendl; - bufferlist response; -#define MAX_REST_RESPONSE (128 * 1024) // we expect a very small response - int ret = svc()->zone->get_master_conn()->forward_iam_request(dpp, key, info, - objv, MAX_REST_RESPONSE, - &in_data, &response, y); - if (ret < 0) - return ret; - - ldpp_dout(dpp, 20) << "response: " << response.c_str() << dendl; - - std::string r = response.c_str(); - std::string str_to_search = """; - std::string str_to_replace = "\""; - boost::replace_all(r, str_to_search, str_to_replace); - ldpp_dout(dpp, 20) << "r: " << r.c_str() << dendl; - - if (parser && !parser->parse(r.c_str(), r.length(), 1)) { - ldpp_dout(dpp, 0) << "ERROR: failed to parse response from master zonegroup" << dendl; - return -EIO; - } - - return 0; -} - std::string RadosStore::zone_unique_id(uint64_t unique_num) { return svc()->zone_utils->unique_id(unique_num); diff --git a/src/rgw/driver/rados/rgw_sal_rados.h b/src/rgw/driver/rados/rgw_sal_rados.h index c46ba8e68f0..0ad6e8fa083 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.h +++ b/src/rgw/driver/rados/rgw_sal_rados.h @@ -139,13 +139,6 @@ class RadosStore : public StoreDriver { int load_bucket(const DoutPrefixProvider* dpp, User* u, const rgw_bucket& b, std::unique_ptr<Bucket>* bucket, optional_yield y) override; virtual bool is_meta_master() override; - virtual int forward_request_to_master(const DoutPrefixProvider *dpp, User* user, obj_version* objv, - bufferlist& in_data, JSONParser* jp, req_info& info, - optional_yield y) override; - virtual int forward_iam_request_to_master(const DoutPrefixProvider *dpp, const RGWAccessKey& key, obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, req_info& info, - optional_yield y) override; virtual Zone* get_zone() { return zone.get(); } virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index a4b0219dd41..1019f48dab4 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -298,14 +298,6 @@ class Driver { std::unique_ptr<Bucket>* bucket, optional_yield y) = 0; /** For multisite, this driver is the zone's master */ virtual bool is_meta_master() = 0; - /** For multisite, forward an OP to the zone's master */ - virtual int forward_request_to_master(const DoutPrefixProvider *dpp, User* user, obj_version* objv, - bufferlist& in_data, JSONParser* jp, req_info& info, - optional_yield y) = 0; - virtual int forward_iam_request_to_master(const DoutPrefixProvider *dpp, const RGWAccessKey& key, obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, req_info& info, - optional_yield y) = 0; /** Get zone info for this driver */ virtual Zone* get_zone() = 0; /** Get a unique ID specific to this zone. */ diff --git a/src/rgw/rgw_sal_dbstore.cc b/src/rgw/rgw_sal_dbstore.cc index 47fa0f06ba7..bce27b912d8 100644 --- a/src/rgw/rgw_sal_dbstore.cc +++ b/src/rgw/rgw_sal_dbstore.cc @@ -1570,22 +1570,6 @@ namespace rgw::sal { return true; } - int DBStore::forward_request_to_master(const DoutPrefixProvider *dpp, User* user, obj_version *objv, - bufferlist& in_data, - JSONParser *jp, req_info& info, - optional_yield y) - { - return 0; - } - - int DBStore::forward_iam_request_to_master(const DoutPrefixProvider *dpp, const RGWAccessKey& key, obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, req_info& info, - optional_yield y) - { - return 0; - } - std::string DBStore::zone_unique_id(uint64_t unique_num) { return ""; diff --git a/src/rgw/rgw_sal_dbstore.h b/src/rgw/rgw_sal_dbstore.h index 7ab98f6286b..bd359d038a2 100644 --- a/src/rgw/rgw_sal_dbstore.h +++ b/src/rgw/rgw_sal_dbstore.h @@ -767,13 +767,6 @@ public: int load_bucket(const DoutPrefixProvider *dpp, User* u, const rgw_bucket& b, std::unique_ptr<Bucket>* bucket, optional_yield y) override; virtual bool is_meta_master() override; - virtual int forward_request_to_master(const DoutPrefixProvider *dpp, User* user, obj_version* objv, - bufferlist& in_data, JSONParser *jp, req_info& info, - optional_yield y) override; - virtual int forward_iam_request_to_master(const DoutPrefixProvider *dpp, const RGWAccessKey& key, obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, req_info& info, - optional_yield y) override; virtual Zone* get_zone() { return &zone; } virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; diff --git a/src/rgw/rgw_sal_filter.cc b/src/rgw/rgw_sal_filter.cc index 01a11351367..b27f1123995 100644 --- a/src/rgw/rgw_sal_filter.cc +++ b/src/rgw/rgw_sal_filter.cc @@ -179,26 +179,6 @@ bool FilterDriver::is_meta_master() return next->is_meta_master(); } -int FilterDriver::forward_request_to_master(const DoutPrefixProvider *dpp, - User* user, obj_version* objv, - bufferlist& in_data, - JSONParser* jp, req_info& info, - optional_yield y) -{ - return next->forward_request_to_master(dpp, user, objv, in_data, jp, info, y); -} - -int FilterDriver::forward_iam_request_to_master(const DoutPrefixProvider *dpp, - const RGWAccessKey& key, - obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, - req_info& info, - optional_yield y) -{ - return next->forward_iam_request_to_master(dpp, key, objv, in_data, parser, info, y); -} - std::string FilterDriver::zone_unique_id(uint64_t unique_num) { return next->zone_unique_id(unique_num); diff --git a/src/rgw/rgw_sal_filter.h b/src/rgw/rgw_sal_filter.h index aec8cd64c2c..8ca3a470e44 100644 --- a/src/rgw/rgw_sal_filter.h +++ b/src/rgw/rgw_sal_filter.h @@ -162,17 +162,6 @@ public: const rgw_bucket& b, std::unique_ptr<Bucket>* bucket, optional_yield y) override; virtual bool is_meta_master() override; - virtual int forward_request_to_master(const DoutPrefixProvider *dpp, User* user, - obj_version* objv, bufferlist& in_data, - JSONParser* jp, req_info& info, - optional_yield y) override; - virtual int forward_iam_request_to_master(const DoutPrefixProvider *dpp, - const RGWAccessKey& key, - obj_version* objv, - bufferlist& in_data, - RGWXMLDecoder::XMLParser* parser, - req_info& info, - optional_yield y) override; virtual Zone* get_zone() override { return zone.get(); } virtual std::string zone_unique_id(uint64_t unique_num) override; virtual std::string zone_unique_trans_id(const uint64_t unique_num) override; |