From: Aashish Sharma Date: Wed, 12 Nov 2025 10:57:58 +0000 (+0530) Subject: mgr/cephadm: Fix RGW zone endpoint auto-update log X-Git-Tag: testing/wip-pdonnell-testing-20260323.122957-tentacle~363 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5e6cfcfc6f851359a17cdf96cbbb46783d3d0ac7;p=ceph-ci.git mgr/cephadm: Fix RGW zone endpoint auto-update log ic in _update_rgw_endpoints method Issue: The existing implementation does not re-attempt endpoint updates when no RGW daemons were found for a service or the daemon deployment is still in progress. The zone is being modified with an empty endpoint array in this case. Fix: Added conditional checks to retry the update if no daemons are found. Fixes: https://tracker.ceph.com/issues/73814 Resolves: rhbz#2406510 Resolves: rhbz#2406696 Signed-off-by: Aashish Sharma (cherry picked from commit c8e878fe5f54b1cee3637f99787950f4616d8041) --- diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index 32ac4de8505..f78c8345889 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -841,7 +841,13 @@ class CephadmServe: ep = [] protocol = 'https' if rgw_spec.ssl else 'http' - for s in self.mgr.cache.get_daemons_by_service(rgw_spec.service_name()): + daemons = self.mgr.cache.get_daemons_by_service(rgw_spec.service_name()) + if not daemons: + self.log.debug(f'No rgw daemons found yet for \ + service {rgw_spec.service_name()}, will retry') + return + + for s in daemons: if s.ports: for p in s.ports: if s.hostname is not None: @@ -849,6 +855,14 @@ class CephadmServe: ep.append(f'{protocol}://{host_addr}:{p}') else: logger.error("Hostname is None for service: %s", s) + + if not ep: + self.log.warning( + "Computed endpoints are empty for service %s; deferring zone update", + rgw_spec.service_name() + ) + return + zone_update_cmd = { 'prefix': 'rgw zone modify', 'realm_name': rgw_spec.rgw_realm, @@ -865,6 +879,7 @@ class CephadmServe: self.mgr.set_health_warning('CEPHADM_RGW', 'Cannot update rgw endpoints, error: {err}', 1, [f'Cannot update rgw endpoints for daemon {rgw_spec.service_name()}, error: {err}']) else: + self.log.debug(f'Successfully updated rgw zone endpoints: {out}') self.mgr.remove_health_warning('CEPHADM_RGW') def _apply_service(self, spec: ServiceSpec) -> Optional[Dict[int, Dict[int, Optional[str]]]]: