RGWBucketInfo master_info;
rgw_bucket *pmaster_bucket;
+ uint32_t *pmaster_num_shards;
real_time creation_time;
if (!store->is_meta_master()) {
ldout(s->cct, 20) << "got creation time: << " << master_info.creation_time << dendl;
pmaster_bucket= &master_info.bucket;
creation_time = master_info.creation_time;
+ pmaster_num_shards = &master_info.num_shards;
pobjv = &objv;
} else {
pmaster_bucket = NULL;
+ pmaster_num_shards = NULL;
}
string zonegroup_id;
placement_rule, s->bucket_info.swift_ver_location,
pquota_info, attrs,
info, pobjv, &ep_objv, creation_time,
- pmaster_bucket, true);
+ pmaster_bucket, pmaster_num_shards, true);
/* continue if EEXIST and create_bucket will fail below. this way we can
* recover from a partial create by retrying it. */
ldout(s->cct, 20) << "rgw_create_bucket returned ret=" << op_ret << " bucket=" << s->bucket << dendl;
obj_version *pep_objv,
real_time creation_time,
rgw_bucket *pmaster_bucket,
+ uint32_t *pmaster_num_shards,
bool exclusive)
{
#define MAX_CREATE_RETRIES 20 /* need to bound retries */
info.index_type = rule_info.index_type;
info.swift_ver_location = swift_ver_location;
info.swift_versioning = (!swift_ver_location.empty());
- info.num_shards = bucket_index_max_shards;
+ if (pmaster_num_shards) {
+ info.num_shards = *pmaster_num_shards;
+ } else {
+ info.num_shards = bucket_index_max_shards;
+ }
info.bucket_index_shard_hash_type = RGWBucketInfo::MOD;
info.requester_pays = false;
if (real_clock::is_zero(creation_time)) {
obj_version *pep_objv,
ceph::real_time creation_time,
rgw_bucket *master_bucket,
+ uint32_t *master_num_shards,
bool exclusive = true);
virtual int add_bucket_placement(std::string& new_pool);
virtual int remove_bucket_placement(std::string& new_pool);