Skip to content

Commit 19aa6f7

Browse files
committed
rgw: respect location constraint in master zonegroup
When creating a bucket with a location constraint specified by the user, this constraint is not included in createparams. Therefore, to create the bucket in the requested location, createparams and bucket_zonegroup must be replaced with the user-provided values. Fixes: https://tracker.ceph.com/issues/62309 Signed-off-by: Seena Fallah <[email protected]>
1 parent 9aab8e7 commit 19aa6f7

File tree

18 files changed

+68
-95
lines changed

18 files changed

+68
-95
lines changed

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
@@ -4257,11 +4257,6 @@ bool RadosZone::get_redirect_endpoint(std::string* endpoint)
42574257
return true;
42584258
}
42594259

4260-
bool RadosZone::has_zonegroup_api(const std::string& api) const
4261-
{
4262-
return store->svc()->zone->has_zonegroup_api(api);
4263-
}
4264-
42654260
const std::string& RadosZone::get_current_period_id()
42664261
{
42674262
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" }},

src/rgw/rgw_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ inline constexpr const char* RGW_REST_STS_XMLNS =
336336
#define ERR_PRESIGNED_URL_EXPIRED 2223
337337
#define ERR_PRESIGNED_URL_DISABLED 2224
338338
#define ERR_AUTHORIZATION 2225 // SNS 403 AuthorizationError
339+
#define ERR_ILLEGAL_LOCATION_CONSTRAINT_EXCEPTION 2226
339340

340341
#define ERR_BUSY_RESHARDING 2300 // also in cls_rgw_types.h, don't change!
341342
#define ERR_NO_SUCH_ENTITY 2301

0 commit comments

Comments
 (0)