]> 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)
committerMatt Benjamin <mbenjamin@redhat.com>
Mon, 27 Apr 2020 23:12:09 +0000 (19:12 -0400)
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>
src/common/legacy_config_opts.h
src/common/options.cc
src/rgw/librgw.cc

index 847991b3cff02209f31f201c2aa7ef6dd1c02af2..a34e2b6304004374a1ba24c30afb4ba16e055eb7 100644 (file)
@@ -1275,6 +1275,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 016a5c32638d7c6e8ea6ce00c6a36dc0e513740c..118e2edfb6f90c8718f578cf99bff8ccbc5a9460 100644 (file)
@@ -5936,6 +5936,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) {