From: benhanokh Date: Wed, 15 Jul 2026 06:38:29 +0000 (+0300) Subject: rgw: add rgw_enable_dedup_threads config to control per-RGW dedup participation X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=36374fc83f9248f60e6543e56723136f58fc1224;p=ceph.git rgw: add rgw_enable_dedup_threads config to control per-RGW dedup participation 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 Assisted-by: Cursor Opus-4.6 --- diff --git a/doc/radosgw/config-ref.rst b/doc/radosgw/config-ref.rst index 8369a827b6a..c759eca76b6 100644 --- a/doc/radosgw/config-ref.rst +++ b/doc/radosgw/config-ref.rst @@ -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 ================== diff --git a/doc/radosgw/s3_objects_dedup.rst b/doc/radosgw/s3_objects_dedup.rst index 9ec4720a6e3..bb05951880f 100644 --- a/doc/radosgw/s3_objects_dedup.rst +++ b/doc/radosgw/s3_objects_dedup.rst @@ -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 =============== diff --git a/src/common/options/rgw.yaml.in b/src/common/options/rgw.yaml.in index 3888e2f92b9..4fb67f9e172 100644 --- a/src/common/options/rgw.yaml.in +++ b/src/common/options/rgw.yaml.in @@ -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 diff --git a/src/rgw/rgw_appmain.cc b/src/rgw/rgw_appmain.cc index cc0322a9f69..dc2bb134803 100644 --- a/src/rgw/rgw_appmain.cc +++ b/src/rgw/rgw_appmain.cc @@ -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 {