summaryrefslogtreecommitdiffstats
path: root/src/rgw
diff options
context:
space:
mode:
authorCasey Bodley <cbodley@redhat.com>2022-07-26 17:48:05 +0200
committerCasey Bodley <cbodley@redhat.com>2023-11-06 17:07:23 +0100
commitbac9bbeaac4c661cd930d0184422d7b4733e8310 (patch)
tree3de3cc768865bf1b8db1b9c90b86f4d9a8976f09 /src/rgw
parentrgw: remove unused RGWObjectSimplePutCR (diff)
downloadceph-bac9bbeaac4c661cd930d0184422d7b4733e8310.tar.xz
ceph-bac9bbeaac4c661cd930d0184422d7b4733e8310.zip
rgw: don't use other zone's shard count for forwarded CreateBucket requests
multisite no longer requires shard counts to match between zones. each zone can configure its own default index shard count, so ignore the shard counts that come from the metadata master zone Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw')
-rw-r--r--src/rgw/driver/rados/rgw_bucket.cc7
-rw-r--r--src/rgw/driver/rados/rgw_bucket.h1
-rw-r--r--src/rgw/driver/rados/rgw_rados.cc6
-rw-r--r--src/rgw/driver/rados/rgw_rados.h3
-rw-r--r--src/rgw/driver/rados/rgw_sal_rados.cc6
5 files changed, 5 insertions, 18 deletions
diff --git a/src/rgw/driver/rados/rgw_bucket.cc b/src/rgw/driver/rados/rgw_bucket.cc
index d6d83eab3dc..fc16316efa4 100644
--- a/src/rgw/driver/rados/rgw_bucket.cc
+++ b/src/rgw/driver/rados/rgw_bucket.cc
@@ -2506,7 +2506,6 @@ int RGWBucketInstanceMetadataHandler::do_put(RGWSI_MetaBackend_Handler::Op *op,
void init_default_bucket_layout(CephContext *cct, rgw::BucketLayout& layout,
const RGWZone& zone,
- std::optional<uint32_t> shards,
std::optional<rgw::BucketIndexType> type) {
layout.current_index.gen = 0;
layout.current_index.layout.normal.hash_type = rgw::BucketHashType::Mod;
@@ -2514,9 +2513,7 @@ void init_default_bucket_layout(CephContext *cct, rgw::BucketLayout& layout,
layout.current_index.layout.type =
type.value_or(rgw::BucketIndexType::Normal);
- if (shards) {
- layout.current_index.layout.normal.num_shards = *shards;
- } else if (cct->_conf->rgw_override_bucket_index_max_shards > 0) {
+ if (cct->_conf->rgw_override_bucket_index_max_shards > 0) {
layout.current_index.layout.normal.num_shards =
cct->_conf->rgw_override_bucket_index_max_shards;
} else {
@@ -2548,7 +2545,7 @@ int RGWMetadataHandlerPut_BucketInstance::put_check(const DoutPrefixProvider *dp
bci.info.layout = rgw::BucketLayout{};
init_default_bucket_layout(cct, bci.info.layout,
bihandler->svc.zone->get_zone(),
- std::nullopt, std::nullopt);
+ std::nullopt);
} else {
bci.info.layout = old_bci->info.layout;
}
diff --git a/src/rgw/driver/rados/rgw_bucket.h b/src/rgw/driver/rados/rgw_bucket.h
index ba0d1cf005c..0110eff3343 100644
--- a/src/rgw/driver/rados/rgw_bucket.h
+++ b/src/rgw/driver/rados/rgw_bucket.h
@@ -45,7 +45,6 @@ extern bool rgw_bucket_object_check_filter(const std::string& oid);
void init_default_bucket_layout(CephContext *cct, rgw::BucketLayout& layout,
const RGWZone& zone,
- std::optional<uint32_t> shards,
std::optional<rgw::BucketIndexType> type);
struct RGWBucketCompleteInfo {
diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc
index b935610f9ad..2df4f77b673 100644
--- a/src/rgw/driver/rados/rgw_rados.cc
+++ b/src/rgw/driver/rados/rgw_rados.cc
@@ -2282,8 +2282,7 @@ int RGWRados::create_bucket(const RGWUserInfo& owner, rgw_bucket& bucket,
obj_version *pobjv,
obj_version *pep_objv,
real_time creation_time,
- rgw_bucket *pmaster_bucket,
- uint32_t *pmaster_num_shards,
+ const rgw_bucket* pmaster_bucket,
optional_yield y,
const DoutPrefixProvider *dpp,
bool exclusive)
@@ -2325,9 +2324,6 @@ int RGWRados::create_bucket(const RGWUserInfo& owner, rgw_bucket& bucket,
info.swift_versioning = (!swift_ver_location.empty());
init_default_bucket_layout(cct, info.layout, svc.zone->get_zone(),
- pmaster_num_shards ?
- std::optional{*pmaster_num_shards} :
- std::nullopt,
rule_info.index_type);
info.requester_pays = false;
diff --git a/src/rgw/driver/rados/rgw_rados.h b/src/rgw/driver/rados/rgw_rados.h
index 2dca3cfaad4..d312e7355e2 100644
--- a/src/rgw/driver/rados/rgw_rados.h
+++ b/src/rgw/driver/rados/rgw_rados.h
@@ -638,8 +638,7 @@ public:
obj_version *pobjv,
obj_version *pep_objv,
ceph::real_time creation_time,
- rgw_bucket *master_bucket,
- uint32_t *master_num_shards,
+ const rgw_bucket *master_bucket,
optional_yield y,
const DoutPrefixProvider *dpp,
bool exclusive = true);
diff --git a/src/rgw/driver/rados/rgw_sal_rados.cc b/src/rgw/driver/rados/rgw_sal_rados.cc
index fb684a921e6..f085afb2bee 100644
--- a/src/rgw/driver/rados/rgw_sal_rados.cc
+++ b/src/rgw/driver/rados/rgw_sal_rados.cc
@@ -186,7 +186,6 @@ int RadosUser::create_bucket(const DoutPrefixProvider* dpp,
bufferlist in_data;
RGWBucketInfo master_info;
rgw_bucket* pmaster_bucket;
- uint32_t* pmaster_num_shards;
real_time creation_time;
std::unique_ptr<Bucket> bucket;
obj_version objv,* pobjv = NULL;
@@ -232,14 +231,12 @@ int RadosUser::create_bucket(const DoutPrefixProvider* dpp,
ldpp_dout(dpp, 20) << "got creation time: << " << std::put_time(std::localtime(&ctime), "%F %T") << dendl;
pmaster_bucket= &master_info.bucket;
creation_time = master_info.creation_time;
- pmaster_num_shards = &master_info.layout.current_index.layout.normal.num_shards;
pobjv = &objv;
if (master_info.obj_lock_enabled()) {
info.flags = BUCKET_VERSIONED | BUCKET_OBJ_LOCK_ENABLED;
}
} else {
pmaster_bucket = NULL;
- pmaster_num_shards = NULL;
if (obj_lock_enabled)
info.flags = BUCKET_VERSIONED | BUCKET_OBJ_LOCK_ENABLED;
}
@@ -264,8 +261,7 @@ int RadosUser::create_bucket(const DoutPrefixProvider* dpp,
ret = store->getRados()->create_bucket(this->get_info(), bucket->get_key(),
zid, placement_rule, swift_ver_location, pquota_info,
attrs, info, pobjv, &ep_objv, creation_time,
- pmaster_bucket, pmaster_num_shards, y, dpp,
- exclusive);
+ pmaster_bucket, y, dpp, exclusive);
if (ret == -EEXIST) {
*existed = true;
/* bucket already existed, might have raced with another bucket creation,