]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: allow disabling rgw_run_sync_thread through spec
authorAdam King <adking@redhat.com>
Mon, 15 Jul 2024 18:14:00 +0000 (14:14 -0400)
committerAdam King <adking@redhat.com>
Wed, 30 Oct 2024 17:38:29 +0000 (13:38 -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>
src/pybind/mgr/cephadm/services/cephadmservice.py
src/pybind/mgr/cephadm/tests/test_services.py
src/python-common/ceph/deployment/service_spec.py

index 9043577bc5a602b1becbbd80db6322066bf55864..9bb4c154602bd3a6fcde7bc8716a6ca78ebc7b5f 100644 (file)
@@ -1144,6 +1144,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 824e37cf4d4937a16d6f9acf2ff0518fdb7f02ae..ed39bac6ef69e78e8987becf10a3efb73bfcee71 100644 (file)
@@ -2044,6 +2044,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 979c14f7d00fd07299f94b1adc3abcec126b45c7..9e8b8d8947aa6118e3071dbe5ae428352de5e8e1 100644 (file)
@@ -1229,6 +1229,7 @@ class RGWSpec(ServiceSpec):
                  rgw_bucket_counters_cache: Optional[bool] = False,
                  rgw_bucket_counters_cache_size: Optional[int] = None,
                  generate_cert: bool = False,
+                 disable_multisite_sync_traffic: Optional[bool] = None,
                  ):
         assert service_type == 'rgw', service_type
 
@@ -1281,6 +1282,8 @@ class RGWSpec(ServiceSpec):
         self.rgw_bucket_counters_cache_size = rgw_bucket_counters_cache_size
         #: Whether we should generate a cert/key for the user if not provided
         self.generate_cert = generate_cert
+        #: 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()]