]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add rgw_enable_dedup_threads config to control per-RGW dedup participation 70210/head
authorbenhanokh <gbenhano@redhat.com>
Wed, 15 Jul 2026 06:38:29 +0000 (09:38 +0300)
committerbenhanokh <gbenhano@redhat.com>
Mon, 20 Jul 2026 14:25:52 +0000 (17:25 +0300)
Add rgw_enable_dedup_threads (default true) and rgw_nfs_run_dedup_threads
(default false) config options to control whether a given RGW instance
participates in dedup background processing.

This follows the same pattern used by rgw_enable_gc_threads,
rgw_enable_lc_threads, and rgw_enable_restore_threads. The config is
evaluated at startup in init_dedup(); when disabled, the dedup Background
object is not created, the thread is not spawned, and the instance does
not register a RADOS watch on the dedup control object.

Disabled RGW instances are invisible to the dedup cluster coordination
mechanism -- they receive no notifications, cause no timeouts, and do
not grab shard tokens.

Signed-off-by: Gabriel BenHanokh <gbenhano@redhat.com>
Assisted-by: Cursor Opus-4.6 <cursoragent@cursor.com>
doc/radosgw/config-ref.rst
doc/radosgw/s3_objects_dedup.rst
src/common/options/rgw.yaml.in
src/rgw/rgw_appmain.cc

index 8369a827b6a3611b469e77c6eb952ed0cf335d97..c759eca76b65f9ca26fe8c20f893e91aa521def4 100644 (file)
@@ -152,6 +152,14 @@ thread running:
 
 .. confval:: rgw_enable_gc_threads
 
+Dedup Settings
+==============
+
+At least one RGW in each zone must have the dedup background thread running
+for dedup operations to function:
+
+.. confval:: rgw_enable_dedup_threads
+
 Multisite Settings
 ==================
 
index 9ec4720a6e34e9cbef0455697ba5a9bf122016bb..bb05951880ff7f9f473d4263e50f09be1baa94a5 100644 (file)
@@ -68,6 +68,24 @@ are treated as comments. Whitespace is ignored. The file must contain at least
 one valid name; an empty or all-comment file is rejected.
 
 
+Configuration
+=============
+
+The dedup background thread must be enabled on at least one RGW daemon in each
+zone for dedup operations to function. Having the thread enabled on multiple
+RGW processes within the same zone spreads the dedup work between them.
+
+.. confval:: rgw_enable_dedup_threads
+
+This setting is evaluated at RGW startup. Changing it requires a daemon
+restart.
+
+When running RGW as an NFS-Ganesha gateway (librgw), the dedup thread is
+disabled by default. To enable it in NFS mode, also set:
+
+.. confval:: rgw_nfs_run_dedup_threads
+
+
 Skipped Objects
 ===============
 
index 3888e2f92b9514fd65b7215b4784ae3f4e7f15f6..4fb67f9e172d51943fd42ee7110484fffcd2b839 100644 (file)
@@ -304,6 +304,23 @@ options:
   - rgw_enable_quota_threads
   - rgw_enable_lc_threads
   with_legacy: true
+- name: rgw_enable_dedup_threads
+  type: bool
+  level: advanced
+  desc: Enables the dedup background maintenance thread.
+  long_desc: The dedup background maintenance thread is responsible for full object
+    deduplication. The thread itself can be disabled, but in order for dedup to work
+    correctly, at least one RGW in each zone needs to have this thread running. Having
+    the thread enabled on multiple RGW processes within the same zone can spread some
+    of the dedup work between them.
+  default: true
+  services:
+  - rgw
+  see_also:
+  - rgw_enable_gc_threads
+  - rgw_enable_lc_threads
+  - rgw_enable_restore_threads
+  with_legacy: true
 - name: rgw_data
   type: str
   level: advanced
@@ -1481,6 +1498,14 @@ options:
   services:
   - rgw
   with_legacy: true
+- name: rgw_nfs_run_dedup_threads
+  type: bool
+  level: advanced
+  desc: run dedup threads in librgw (default off)
+  default: false
+  services:
+  - rgw
+  with_legacy: true
 - name: rgw_nfs_run_sync_thread
   type: bool
   level: advanced
index cc0322a9f69c31a4a4c05b8a5c89e0d5b3da037b..dc2bb13480300e79783941b06dede2eaa065b2a5 100644 (file)
@@ -591,6 +591,14 @@ void rgw::AppMain::init_lua()
 #ifdef WITH_RADOSGW_RADOS
 void rgw::AppMain::init_dedup()
 {
+  auto run_dedup =
+    (g_conf()->rgw_enable_dedup_threads &&
+      ((!nfs) || (nfs && g_conf()->rgw_nfs_run_dedup_threads)));
+
+  if (!run_dedup) {
+    return;
+  }
+
   rgw::sal::Driver* driver = env.driver;
   if (driver->get_name() == "rados") { /* Supported for only RadosStore */
     try {