Skip to content

Commit cb47171

Browse files
authored
Merge pull request ceph#58604 from adk3798/cephadm-rgw-no-multisite-traffic
mgr/cephadm: allow disabling rgw_run_sync_thread through spec Reviewed-by: Redouane Kachach <[email protected]>
2 parents 2ceb7a6 + 8878619 commit cb47171

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

doc/cephadm/services/rgw.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,32 @@ Then apply this yaml document:
173173
Note the value of ``rgw_frontend_ssl_certificate`` is a literal string as
174174
indicated by a ``|`` character preserving newline characters.
175175

176+
Disabling multisite sync traffic
177+
--------------------------------
178+
179+
There is an RGW config option called ``rgw_run_sync_thread`` that tells the
180+
RGW daemon to not transmit multisite replication data. This is useful if you want
181+
that RGW daemon to be dedicated to I/O rather than multisite sync operations.
182+
The RGW spec file includes a setting ``disable_multisite_sync_traffic`` that when
183+
set to "True" will tell cephadm to set ``rgw_run_sync_thread`` to false for all
184+
RGW daemons deployed for that RGW service. For example
185+
186+
.. code-block:: yaml
187+
188+
service_type: rgw
189+
service_id: foo
190+
placement:
191+
label: rgw
192+
spec:
193+
rgw_realm: myrealm
194+
rgw_zone: myzone
195+
rgw_zonegroup: myzg
196+
disable_multisite_sync_traffic: True
197+
198+
.. note:: This will only stop the RGW daemon(s) from sending replication data.
199+
The daemon can still receive replication data unless it has been removed
200+
from the zonegroup and zone replication endpoints.
201+
176202
Service specification
177203
---------------------
178204

src/pybind/mgr/cephadm/services/cephadmservice.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,14 @@ def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonD
11571157
'value': str(spec.rgw_bucket_counters_cache_size),
11581158
})
11591159

1160+
if getattr(spec, 'disable_multisite_sync_traffic', None) is not None:
1161+
ret, out, err = self.mgr.check_mon_command({
1162+
'prefix': 'config set',
1163+
'who': daemon_name,
1164+
'name': 'rgw_run_sync_thread',
1165+
'value': 'false' if spec.disable_multisite_sync_traffic else 'true',
1166+
})
1167+
11601168
daemon_spec.keyring = keyring
11611169
daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
11621170

src/pybind/mgr/cephadm/tests/test_services.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,26 @@ def test_rgw_update(self, frontend, ssl, extra_args, expected, cephadm_module: C
20712071
})
20722072
assert f == expected
20732073

2074+
@pytest.mark.parametrize(
2075+
"disable_sync_traffic",
2076+
[
2077+
(True),
2078+
(False),
2079+
]
2080+
)
2081+
@patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
2082+
def test_rgw_disable_sync_traffic(self, disable_sync_traffic, cephadm_module: CephadmOrchestrator):
2083+
with with_host(cephadm_module, 'host1'):
2084+
s = RGWSpec(service_id="foo",
2085+
disable_multisite_sync_traffic=disable_sync_traffic)
2086+
with with_service(cephadm_module, s) as dds:
2087+
_, f, _ = cephadm_module.check_mon_command({
2088+
'prefix': 'config get',
2089+
'who': f'client.{dds[0]}',
2090+
'key': 'rgw_run_sync_thread',
2091+
})
2092+
assert f == ('false' if disable_sync_traffic else 'true')
2093+
20742094

20752095
class TestMonService:
20762096

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,7 @@ def __init__(self,
12311231
rgw_bucket_counters_cache: Optional[bool] = False,
12321232
rgw_bucket_counters_cache_size: Optional[int] = None,
12331233
generate_cert: bool = False,
1234+
disable_multisite_sync_traffic: Optional[bool] = None,
12341235
):
12351236
assert service_type == 'rgw', service_type
12361237

@@ -1283,6 +1284,8 @@ def __init__(self,
12831284
self.rgw_bucket_counters_cache_size = rgw_bucket_counters_cache_size
12841285
#: Whether we should generate a cert/key for the user if not provided
12851286
self.generate_cert = generate_cert
1287+
#: Used to make RGW not do multisite replication so it can dedicate to IO
1288+
self.disable_multisite_sync_traffic = disable_multisite_sync_traffic
12861289

12871290
def get_port_start(self) -> List[int]:
12881291
return [self.get_port()]

0 commit comments

Comments
 (0)