Skip to content

Commit 46a6f8e

Browse files
authored
Merge pull request ceph#52791 from clwluvw/location-constraint
rgw: check for location constraint on master zonegroup Reviewed-by: Casey Bodley <[email protected]>
2 parents 65271d8 + c21b5f7 commit 46a6f8e

File tree

19 files changed

+70
-95
lines changed

19 files changed

+70
-95
lines changed

qa/tasks/rgw_multisite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ def create_zonegroup(cluster, gateways, period, config):
361361
if endpoints:
362362
# replace client names with their gateway endpoints
363363
config['endpoints'] = extract_gateway_endpoints(gateways, endpoints)
364+
if not config.get('api_name'): # otherwise it will be set to an empty string
365+
config['api_name'] = config['name']
364366
zonegroup = multisite.ZoneGroup(config['name'], period)
365367
# `zonegroup set` needs --default on command line, and 'is_master' in json
366368
args = is_default_arg(config)

src/rgw/driver/daos/rgw_sal_daos.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,6 @@ bool DaosZone::is_writeable() { return true; }
858858

859859
bool DaosZone::get_redirect_endpoint(std::string* endpoint) { return false; }
860860

861-
bool DaosZone::has_zonegroup_api(const std::string& api) const { return false; }
862-
863861
const std::string& DaosZone::get_current_period_id() {
864862
return current_period->get_id();
865863
}

src/rgw/driver/daos/rgw_sal_daos.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ class DaosZone : public StoreZone {
484484
virtual const std::string& get_name() const override;
485485
virtual bool is_writeable() override;
486486
virtual bool get_redirect_endpoint(std::string* endpoint) override;
487-
virtual bool has_zonegroup_api(const std::string& api) const override;
488487
virtual const std::string& get_current_period_id() override;
489488
virtual const RGWAccessKey& get_system_key() {
490489
return zone_params->system_key;

src/rgw/driver/motr/rgw_sal_motr.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,11 +1111,6 @@ bool MotrZone::get_redirect_endpoint(std::string* endpoint)
11111111
return false;
11121112
}
11131113

1114-
bool MotrZone::has_zonegroup_api(const std::string& api) const
1115-
{
1116-
return (zonegroup.group.api_name == api);
1117-
}
1118-
11191114
const std::string& MotrZone::get_current_period_id()
11201115
{
11211116
return current_period->get_id();

src/rgw/driver/motr/rgw_sal_motr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ class MotrZone : public StoreZone {
525525
virtual const std::string& get_name() const override;
526526
virtual bool is_writeable() override;
527527
virtual bool get_redirect_endpoint(std::string* endpoint) override;
528-
virtual bool has_zonegroup_api(const std::string& api) const override;
529528
virtual const std::string& get_current_period_id() override;
530529
virtual const RGWAccessKey& get_system_key() { return zone_params->system_key; }
531530
virtual const std::string& get_realm_name() { return realm->get_name(); }

src/rgw/driver/rados/rgw_period.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,6 @@ int RGWPeriod::delete_obj(const DoutPrefixProvider *dpp, optional_yield y)
6868
return ret;
6969
}
7070

71-
int RGWPeriod::add_zonegroup(const DoutPrefixProvider *dpp, const RGWZoneGroup& zonegroup, optional_yield y)
72-
{
73-
if (zonegroup.realm_id != realm_id) {
74-
return 0;
75-
}
76-
int ret = period_map.update(zonegroup, cct);
77-
if (ret < 0) {
78-
ldpp_dout(dpp, 0) << "ERROR: updating period map: " << cpp_strerror(-ret) << dendl;
79-
return ret;
80-
}
81-
82-
return store_info(dpp, false, y);
83-
}
84-
8571
int RGWPeriod::update(const DoutPrefixProvider *dpp, optional_yield y)
8672
{
8773
auto zone_svc = sysobj_svc->get_zone_svc();

src/rgw/driver/rados/rgw_sal_rados.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4500,11 +4500,6 @@ bool RadosZone::get_redirect_endpoint(std::string* endpoint)
45004500
return true;
45014501
}
45024502

4503-
bool RadosZone::has_zonegroup_api(const std::string& api) const
4504-
{
4505-
return store->svc()->zone->has_zonegroup_api(api);
4506-
}
4507-
45084503
const std::string& RadosZone::get_current_period_id()
45094504
{
45104505
return store->svc()->zone->get_current_period_id();

src/rgw/driver/rados/rgw_sal_rados.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ class RadosZone : public StoreZone {
107107
virtual const std::string& get_name() const override;
108108
virtual bool is_writeable() override;
109109
virtual bool get_redirect_endpoint(std::string* endpoint) override;
110-
virtual bool has_zonegroup_api(const std::string& api) const override;
111110
virtual const std::string& get_current_period_id() override;
112111
virtual const RGWAccessKey& get_system_key() override;
113112
virtual const std::string& get_realm_name() override;

src/rgw/driver/rados/rgw_zone.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,6 @@ class RGWPeriod
769769
int create(const DoutPrefixProvider *dpp, optional_yield y, bool exclusive = true);
770770
int delete_obj(const DoutPrefixProvider *dpp, optional_yield y);
771771
int store_info(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y);
772-
int add_zonegroup(const DoutPrefixProvider *dpp, const RGWZoneGroup& zonegroup, optional_yield y);
773772

774773
void fork();
775774
int update(const DoutPrefixProvider *dpp, optional_yield y);

src/rgw/rgw_common.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ rgw_http_errors rgw_http_s3_errors({
6363
{ ERR_INVALID_DIGEST, {400, "InvalidDigest" }},
6464
{ ERR_BAD_DIGEST, {400, "BadDigest" }},
6565
{ ERR_INVALID_LOCATION_CONSTRAINT, {400, "InvalidLocationConstraint" }},
66+
{ ERR_ILLEGAL_LOCATION_CONSTRAINT_EXCEPTION, {400, "IllegalLocationConstraintException" }},
6667
{ ERR_ZONEGROUP_DEFAULT_PLACEMENT_MISCONFIGURATION, {400, "ZonegroupDefaultPlacementMisconfiguration" }},
6768
{ ERR_INVALID_BUCKET_NAME, {400, "InvalidBucketName" }},
6869
{ ERR_INVALID_OBJECT_NAME, {400, "InvalidObjectName" }},

0 commit comments

Comments
 (0)