]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: allow disabling rgw_run_sync_thread through spec 61350/head
authorAdam King <adking@redhat.com>
Mon, 15 Jul 2024 18:14:00 +0000 (14:14 -0400)
committerAdam King <adking@redhat.com>
Sat, 21 Jun 2025 19:56:20 +0000 (15:56 -0400)
This is desirable for an RGW service that you don't want to
send multisite sync data so the RGW daemons can focus more
on handling IO. Note they may still receive mulsitie sync
data unless they are removed from the zone and zonegroup
replication endpoints

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit d620ba65121e2a3c418d39823bc7752cd12c9f80)

Conflicts:
src/python-common/ceph/deployment/service_spec.py

src/pybind/mgr/cephadm/services/cephadmservice.py
src/pybind/mgr/cephadm/tests/test_services.py
src/python-common/ceph/deployment/service_spec.py

index 1792cd28fcca151b0cd2fb32816d3c2e6b3ce570..8b4663519a724e1ac6e3186b2acd8a21a35242e3 100644 (file)
@@ -1081,6 +1081,14 @@ class RgwService(CephService):
                 'value': str(spec.rgw_bucket_counters_cache_size),
             })
 
+        if getattr(spec, 'disable_multisite_sync_traffic', None) is not None:
+            ret, out, err = self.mgr.check_mon_command({
+                'prefix': 'config set',
+                'who': daemon_name,
+                'name': 'rgw_run_sync_thread',
+                'value': 'false' if spec.disable_multisite_sync_traffic else 'true',
+            })
+
         daemon_spec.keyring = keyring
         daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
 
index 617d12bc8b620ab74af947bb54c41e8cc6a49516..a595948f5c0210c533ad0ade7105f1aa94b2f674 100644 (file)
@@ -1474,6 +1474,26 @@ class TestRGWService:
                 })
                 assert f == expected
 
+    @pytest.mark.parametrize(
+        "disable_sync_traffic",
+        [
+            (True),
+            (False),
+        ]
+    )
+    @patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
+    def test_rgw_disable_sync_traffic(self, disable_sync_traffic, cephadm_module: CephadmOrchestrator):
+        with with_host(cephadm_module, 'host1'):
+            s = RGWSpec(service_id="foo",
+                        disable_multisite_sync_traffic=disable_sync_traffic)
+            with with_service(cephadm_module, s) as dds:
+                _, f, _ = cephadm_module.check_mon_command({
+                    'prefix': 'config get',
+                    'who': f'client.{dds[0]}',
+                    'key': 'rgw_run_sync_thread',
+                })
+                assert f == ('false' if disable_sync_traffic else 'true')
+
 
 class TestMonService:
 
index d99f656fbfe1722471662c44ebc45d90ba8a3929..6ed7b5355dc4671c818c469702ccfade95779934 100644 (file)
@@ -1224,6 +1224,7 @@ class RGWSpec(ServiceSpec):
                  rgw_user_counters_cache_size: Optional[int] = None,
                  rgw_bucket_counters_cache: Optional[bool] = False,
                  rgw_bucket_counters_cache_size: Optional[int] = None,
+                 disable_multisite_sync_traffic: Optional[bool] = None,
                  ):
         assert service_type == 'rgw', service_type
 
@@ -1273,6 +1274,8 @@ class RGWSpec(ServiceSpec):
         self.rgw_bucket_counters_cache = rgw_bucket_counters_cache
         #: Used to set number of entries in each cache of bucket counters
         self.rgw_bucket_counters_cache_size = rgw_bucket_counters_cache_size
+        #: Used to make RGW not do multisite replication so it can dedicate to IO
+        self.disable_multisite_sync_traffic = disable_multisite_sync_traffic
 
     def get_port_start(self) -> List[int]:
         return [self.get_port()]