]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add configure_bucket_trim()
authorCasey Bodley <cbodley@redhat.com>
Thu, 7 Sep 2017 16:48:47 +0000 (12:48 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 10 Nov 2017 18:23:01 +0000 (13:23 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/options.cc
src/rgw/rgw_sync_log_trim.cc

index 2e70f1c592ec34980df6410031c52b8672888303..881a18d73d1e8b674acf89c7ccf026cfb05e8632 100644 (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(""),
index a3c21329822c20425b4c7aec74b08d8ddc7569df..0ff0b0e169bc7eb3cc7ec2dcf9dcb30c64ee8dab 100644 (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: