OPTION(rgw_max_chunk_size, OPT_INT, 512 * 1024)
/**
+ * override max bucket index shards in zone configuration (if not zero)
+ *
* Represents the number of shards for the bucket index object, a value of zero
* indicates there is no sharding. By default (no sharding, the name of the object
* is '.dir.{marker}', with sharding, the name is '.dir.{markder}.{sharding_id}',
* sharding_id is zero-based value. It is not recommended to set a too large value
* (e.g. thousand) as it increases the cost for bucket listing.
*/
-OPTION(rgw_bucket_index_max_shards, OPT_U32, 0)
+OPTION(rgw_override_bucket_index_max_shards, OPT_U32, 0)
/**
* Represents the maximum AIO pending requests for the bucket index object shards.
encode_json("endpoints", endpoints, f);
encode_json("log_meta", log_meta, f);
encode_json("log_data", log_data, f);
+ encode_json("bucket_index_max_shards", bucket_index_max_shards, f);
}
void RGWZone::decode_json(JSONObj *obj)
JSONDecoder::decode_json("endpoints", endpoints, obj);
JSONDecoder::decode_json("log_meta", log_meta, obj);
JSONDecoder::decode_json("log_data", log_data, obj);
+ JSONDecoder::decode_json("bucket_index_max_shards", bucket_index_max_shards, obj);
}
void RGWRegionPlacementTarget::dump(Formatter *f) const
{
int ret;
- bucket_index_max_shards = cct->_conf->rgw_bucket_index_max_shards;
- if (bucket_index_max_shards > MAX_BUCKET_INDEX_SHARDS_PRIME) {
- bucket_index_max_shards = MAX_BUCKET_INDEX_SHARDS_PRIME;
- ldout(cct, 1) << __func__ << " bucket index max shards is too large, reset to value: "
- << MAX_BUCKET_INDEX_SHARDS_PRIME << dendl;
- }
- ldout(cct, 20) << __func__ << " bucket index max shards: " << bucket_index_max_shards << dendl;
-
rados = new Rados();
if (!rados)
return -ENOMEM;
quota_handler = RGWQuotaHandler::generate_handler(this, quota_threads);
+ bucket_index_max_shards = (cct->_conf->rgw_override_bucket_index_max_shards ? cct->_conf->rgw_override_bucket_index_max_shards :
+ zone_public_config.bucket_index_max_shards);
+ if (bucket_index_max_shards > MAX_BUCKET_INDEX_SHARDS_PRIME) {
+ bucket_index_max_shards = MAX_BUCKET_INDEX_SHARDS_PRIME;
+ ldout(cct, 1) << __func__ << " bucket index max shards is too large, reset to value: "
+ << MAX_BUCKET_INDEX_SHARDS_PRIME << dendl;
+ }
+ ldout(cct, 20) << __func__ << " bucket index max shards: " << bucket_index_max_shards << dendl;
+
return ret;
}
bool log_meta;
bool log_data;
- RGWZone() : log_meta(false), log_data(false) {}
+/**
+ * Represents the number of shards for the bucket index object, a value of zero
+ * indicates there is no sharding. By default (no sharding, the name of the object
+ * is '.dir.{marker}', with sharding, the name is '.dir.{markder}.{sharding_id}',
+ * sharding_id is zero-based value. It is not recommended to set a too large value
+ * (e.g. thousand) as it increases the cost for bucket listing.
+ */
+ uint32_t bucket_index_max_shards;
+
+ RGWZone() : log_meta(false), log_data(false), bucket_index_max_shards(0) {}
void encode(bufferlist& bl) const {
- ENCODE_START(2, 1, bl);
+ ENCODE_START(3, 1, bl);
::encode(name, bl);
::encode(endpoints, bl);
::encode(log_meta, bl);
::encode(log_data, bl);
+ ::encode(bucket_index_max_shards, bl);
ENCODE_FINISH(bl);
}
::decode(log_meta, bl);
::decode(log_data, bl);
}
+ if (struct_v >= 3) {
+ ::decode(bucket_index_max_shards, bl);
+ }
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;