]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: Fix RGW zone endpoint auto-update log
authorAashish Sharma <Aashish.Sharma1@ibm.com>
Wed, 12 Nov 2025 10:57:58 +0000 (16:27 +0530)
committerAashish Sharma <Aashish.Sharma1@ibm.com>
Fri, 14 Nov 2025 10:01:43 +0000 (15:31 +0530)
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 <aasharma@redhat.com>
(cherry picked from commit c8e878fe5f54b1cee3637f99787950f4616d8041)

src/pybind/mgr/cephadm/serve.py

index 32ac4de8505edd3fa8928ba925b8649de1497cf0..f78c8345889c396eec867b948db66d97253a6c00 100644 (file)
@@ -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]]]]: