OPTION(rgw_swift_need_stats, OPT_BOOL) // option to enable stats on bucket listing for swift
-/* resharding tunables */
-OPTION(rgw_reshard_num_logs, OPT_INT)
-OPTION(rgw_reshard_bucket_lock_duration, OPT_INT) // duration of lock on bucket obj during resharding
-OPTION(rgw_dynamic_resharding, OPT_BOOL)
-OPTION(rgw_max_objs_per_shard, OPT_INT)
-OPTION(rgw_reshard_thread_interval, OPT_U32) // maximum time between rounds of reshard thread processing
-
OPTION(rgw_acl_grants_max_num, OPT_INT) // According to AWS S3(http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html), An ACL can have up to 100 grants.
OPTION(rgw_cors_rules_max_num, OPT_INT) // According to AWS S3(http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html), An cors can have up to 100 rules.
OPTION(rgw_delete_multi_obj_max_num, OPT_INT) // According to AWS S3(https://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingObjects.html), Amazon S3 also provides the Multi-Object Delete API that you can use to delete up to 1000 objects in a single HTTP request.
"a high number of objects per shard.")
.add_see_also("rgw_max_objs_per_shard"),
- Option("rgw_max_objs_per_shard", Option::TYPE_INT, Option::LEVEL_BASIC)
+ Option("rgw_max_objs_per_shard", Option::TYPE_UINT, Option::LEVEL_BASIC)
.set_default(100000)
.set_description("Max objects per shard for dynamic resharding")
.set_long_description(
g_conf()->rgw_enable_lc_threads,
g_conf()->rgw_enable_quota_threads,
g_conf()->rgw_run_sync_thread,
- g_conf()->rgw_dynamic_resharding);
+ g_conf().get_val<bool>("rgw_dynamic_resharding"));
if (!store) {
mutex.Lock();
max_entries = 1000;
}
- int num_logshards = store->ctx()->_conf->rgw_reshard_num_logs;
+ int num_logshards =
+ store->ctx()->_conf.get_val<uint64_t>("rgw_reshard_num_logs");
RGWReshard reshard(store);
int ret = br.cancel();
if (ret < 0) {
if (ret == -EBUSY) {
- cerr << "There is ongoing resharding, please retry after " << g_conf()->rgw_reshard_bucket_lock_duration <<
- " seconds " << std::endl;
+ cerr << "There is ongoing resharding, please retry after " <<
+ store->ctx()->_conf.get_val<uint64_t>(
+ "rgw_reshard_bucket_lock_duration") <<
+ " seconds " << std::endl;
} else {
- cerr << "Error canceling bucket " << bucket_name << " resharding: " << cpp_strerror(-ret) <<
- std::endl;
+ cerr << "Error canceling bucket " << bucket_name <<
+ " resharding: " << cpp_strerror(-ret) << std::endl;
}
return ret;
}
FCGX_Init();
#endif
- RGWRados *store = RGWStoreManager::get_storage(g_ceph_context,
- g_conf()->rgw_enable_gc_threads, g_conf()->rgw_enable_lc_threads, g_conf()->rgw_enable_quota_threads,
- g_conf()->rgw_run_sync_thread, g_conf()->rgw_dynamic_resharding, g_conf()->rgw_cache_enabled);
+ RGWRados *store =
+ RGWStoreManager::get_storage(g_ceph_context,
+ g_conf()->rgw_enable_gc_threads,
+ g_conf()->rgw_enable_lc_threads,
+ g_conf()->rgw_enable_quota_threads,
+ g_conf()->rgw_run_sync_thread,
+ g_conf().get_val<bool>("rgw_dynamic_resharding"),
+ g_conf()->rgw_cache_enabled);
if (!store) {
mutex.Lock();
init_timer.cancel_all_events();
int RGWRados::check_bucket_shards(const RGWBucketInfo& bucket_info, const rgw_bucket& bucket,
RGWQuotaInfo& bucket_quota)
{
- if (!cct->_conf->rgw_dynamic_resharding) {
+ if (! cct->_conf.get_val<bool>("rgw_dynamic_resharding")) {
return 0;
}
int num_source_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
uint32_t suggested_num_shards;
- int ret = quota_handler->check_bucket_shards((uint64_t)cct->_conf->rgw_max_objs_per_shard,
- num_source_shards, bucket_info.owner, bucket, bucket_quota,
- 1, need_resharding, &suggested_num_shards);
+ const uint64_t max_objs_per_shard =
+ cct->_conf.get_val<uint64_t>("rgw_max_objs_per_shard");
+ int ret =
+ quota_handler->check_bucket_shards(max_objs_per_shard, num_source_shards,
+ bucket_info.owner, bucket, bucket_quota,
+ 1, need_resharding, &suggested_num_shards);
if (ret < 0) {
return ret;
}
while (!store) {
// recreate and initialize a new store
- store = RGWStoreManager::get_storage(cct,
- cct->_conf->rgw_enable_gc_threads,
- cct->_conf->rgw_enable_lc_threads,
- cct->_conf->rgw_enable_quota_threads,
- cct->_conf->rgw_run_sync_thread,
- cct->_conf->rgw_dynamic_resharding,
- cct->_conf->rgw_cache_enabled
- );
+ store =
+ RGWStoreManager::get_storage(cct,
+ cct->_conf->rgw_enable_gc_threads,
+ cct->_conf->rgw_enable_lc_threads,
+ cct->_conf->rgw_enable_quota_threads,
+ cct->_conf->rgw_run_sync_thread,
+ cct->_conf.get_val<bool>("rgw_dynamic_resharding"),
+ cct->_conf->rgw_cache_enabled);
ldout(cct, 1) << "Creating new store" << dendl;
store(_store), instance_lock(bucket_instance_lock_name),
verbose(_verbose), out(_out), formatter(_formatter)
{
- num_logshards = store->ctx()->_conf->rgw_reshard_num_logs;
+ num_logshards = store->ctx()->_conf.get_val<uint64_t>("rgw_reshard_num_logs");
}
-string RGWReshard::get_logshard_key(const string& tenant, const string& bucket_name)
+string RGWReshard::get_logshard_key(const string& tenant,
+ const string& bucket_name)
{
return tenant + ":" + bucket_name;
}