Skip to content

Commit d620ba6

Browse files
committed
mgr/cephadm: allow disabling rgw_run_sync_thread through spec
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 <[email protected]>
1 parent 81e274b commit d620ba6

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

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

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

1147+
if getattr(spec, 'disable_multisite_sync_traffic', None) is not None:
1148+
ret, out, err = self.mgr.check_mon_command({
1149+
'prefix': 'config set',
1150+
'who': daemon_name,
1151+
'name': 'rgw_run_sync_thread',
1152+
'value': 'false' if spec.disable_multisite_sync_traffic else 'true',
1153+
})
1154+
11471155
daemon_spec.keyring = keyring
11481156
daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
11491157

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

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

2047+
@pytest.mark.parametrize(
2048+
"disable_sync_traffic",
2049+
[
2050+
(True),
2051+
(False),
2052+
]
2053+
)
2054+
@patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
2055+
def test_rgw_disable_sync_traffic(self, disable_sync_traffic, cephadm_module: CephadmOrchestrator):
2056+
with with_host(cephadm_module, 'host1'):
2057+
s = RGWSpec(service_id="foo",
2058+
disable_multisite_sync_traffic=disable_sync_traffic)
2059+
with with_service(cephadm_module, s) as dds:
2060+
_, f, _ = cephadm_module.check_mon_command({
2061+
'prefix': 'config get',
2062+
'who': f'client.{dds[0]}',
2063+
'key': 'rgw_run_sync_thread',
2064+
})
2065+
assert f == ('false' if disable_sync_traffic else 'true')
2066+
20472067

20482068
class TestMonService:
20492069

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ def __init__(self,
12291229
rgw_bucket_counters_cache: Optional[bool] = False,
12301230
rgw_bucket_counters_cache_size: Optional[int] = None,
12311231
generate_cert: bool = False,
1232+
disable_multisite_sync_traffic: Optional[bool] = None,
12321233
):
12331234
assert service_type == 'rgw', service_type
12341235

@@ -1281,6 +1282,8 @@ def __init__(self,
12811282
self.rgw_bucket_counters_cache_size = rgw_bucket_counters_cache_size
12821283
#: Whether we should generate a cert/key for the user if not provided
12831284
self.generate_cert = generate_cert
1285+
#: Used to make RGW not do multisite replication so it can dedicate to IO
1286+
self.disable_multisite_sync_traffic = disable_multisite_sync_traffic
12841287

12851288
def get_port_start(self) -> List[int]:
12861289
return [self.get_port()]

0 commit comments

Comments
 (0)