rgw: add configure_bucket_trim()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2017-09-07 12:48:47 -04:00
parent 7be4eab8a3
commit d29f96ae3e
2 changed files with 31 additions and 0 deletions

View File

@ -5010,6 +5010,18 @@ std::vector<Option> get_rgw_options() {
.set_default(1200)
.set_description(""),
Option("rgw_sync_log_trim_max_buckets", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(16)
.set_description("Maximum number of buckets to trim per interval"),
Option("rgw_sync_log_trim_min_cold_buckets", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(4)
.set_description("Minimum number of cold buckets to trim per interval"),
Option("rgw_sync_log_trim_concurrent_buckets", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(4)
.set_description("Maximum number of buckets to trim in parallel"),
Option("rgw_sync_data_inject_err_probability", Option::TYPE_FLOAT, Option::LEVEL_DEV)
.set_default(0)
.set_description(""),

View File

@ -737,6 +737,25 @@ class RecentEventList {
namespace rgw {
// read bucket trim configuration from ceph context
void configure_bucket_trim(CephContext *cct, BucketTrimConfig& config)
{
auto conf = cct->_conf;
config.trim_interval_sec =
conf->get_val<int64_t>("rgw_sync_log_trim_interval");
config.counter_size = 512;
config.buckets_per_interval =
conf->get_val<int64_t>("rgw_sync_log_trim_max_buckets");
config.min_cold_buckets_per_interval =
conf->get_val<int64_t>("rgw_sync_log_trim_min_cold_buckets");
config.concurrent_buckets =
conf->get_val<int64_t>("rgw_sync_log_trim_concurrent_buckets");
config.notify_timeout_ms = 10;
config.recent_size = 128;
config.recent_duration = std::chrono::hours(2);
}
class BucketTrimManager::Impl : public TrimCounters::Server,
public BucketTrimObserver {
public: