]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: nfs: disable gc, lc, quota, and sync threads by default
authorMatt Benjamin <mbenjamin@redhat.com>
Mon, 27 Apr 2020 23:07:47 +0000 (19:07 -0400)
committerNathan Cutler <ncutler@suse.com>
Sun, 9 Aug 2020 20:49:12 +0000 (22:49 +0200)
These can be overridden by new options, should a site decide to
run a librgw with no radosgw instances.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit ccff9f122b94e25f1c6947cbc08a51577ccc6431)

src/common/legacy_config_opts.h
src/common/options.cc
src/rgw/librgw.cc

index b0562247dda99cac9344264548cfffa0e3550c54..287326fc35b969cbe492c7cb7eca739dc5d9b63b 100644 (file)
@@ -1276,6 +1276,11 @@ OPTION(rgw_enable_quota_threads, OPT_BOOL)
 OPTION(rgw_enable_gc_threads, OPT_BOOL)
 OPTION(rgw_enable_lc_threads, OPT_BOOL)
 
+/* overrides for librgw/nfs */
+OPTION(rgw_nfs_run_gc_threads, OPT_BOOL)
+OPTION(rgw_nfs_run_lc_threads, OPT_BOOL)
+OPTION(rgw_nfs_run_quota_threads, OPT_BOOL)
+OPTION(rgw_nfs_run_sync_thread, OPT_BOOL)
 
 OPTION(rgw_data, OPT_STR)
 OPTION(rgw_enable_apis, OPT_STR)
index b4e41834c6a63b79ca38faa07db458f4695f08be..a8878bce5450158858e9f570b1a8b5eeb4ab9885 100644 (file)
@@ -5931,6 +5931,22 @@ std::vector<Option> get_rgw_options() {
     .set_long_description("use fast S3 attrs from bucket index (assumes NFS "
                          "mounts are immutable)"),
 
+    Option("rgw_nfs_run_gc_threads", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(false)
+    .set_description("run GC threads in librgw (default off)"),
+
+    Option("rgw_nfs_run_lc_threads", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(false)
+    .set_description("run lifecycle threads in librgw (default off)"),
+
+    Option("rgw_nfs_run_quota_threads", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(false)
+    .set_description("run quota threads in librgw (default off)"),
+
+    Option("rgw_nfs_run_sync_thread", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(false)
+    .set_description("run sync thread in librgw (default off)"),
+
     Option("rgw_rados_pool_autoscale_bias", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
     .set_default(4.0)
     .set_min_max(0.01, 100000.0)
index 23e5e099180f559d6da0a9ca1e2440d194ba7355..9b0bc92423e87d6d8ec1e2cda1cea968e962df37 100644 (file)
@@ -508,11 +508,27 @@ namespace rgw {
     rgw::curl::setup_curl(boost::none);
     rgw_http_client_init(g_ceph_context);
 
+    auto run_gc =
+      g_conf()->rgw_enable_gc_threads &&
+      g_conf()->rgw_nfs_run_gc_threads;
+
+    auto run_lc =
+      g_conf()->rgw_enable_lc_threads &&
+      g_conf()->rgw_nfs_run_lc_threads;
+
+    auto run_quota =
+      g_conf()->rgw_enable_quota_threads &&
+      g_conf()->rgw_nfs_run_quota_threads;
+
+    auto run_sync =
+      g_conf()->rgw_run_sync_thread &&
+      g_conf()->rgw_nfs_run_sync_thread;
+
     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,
+                                        run_gc,
+                                        run_lc,
+                                        run_quota,
+                                        run_sync,
                                         g_conf().get_val<bool>("rgw_dynamic_resharding"));
 
     if (!store) {