]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: clear daemon_config_deps entry for removed daemons 69849/head
authorAdam King <adking@redhat.com>
Tue, 30 Jun 2026 19:31:20 +0000 (15:31 -0400)
committerAdam King <adking@redhat.com>
Tue, 30 Jun 2026 19:31:20 +0000 (15:31 -0400)
This covers both removing them actively from now on when removing
daemons from the HostCache and also not loading entries like this
back in next time they are loaded when a user upgrades to a
version with this patch

Fixes: https://tracker.ceph.com/issues/77839
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/inventory.py

index 7e396401e38e9e0b5f5912bf86e23560ce3481c7..18e550496001486894f7ef75f054766ce2543bbe 100644 (file)
@@ -854,6 +854,10 @@ class HostCache():
                     self.osdspec_last_applied[host][name] = str_to_datetime(ts)
 
                 for name, d in j.get('daemon_config_deps', {}).items():
+                    # drop potential leftover daemon_config_deps entries
+                    # assume if we didn't find a daemon entry, it's a leftover
+                    if name not in self.daemons.get(host, {}):
+                        continue
                     self.daemon_config_deps[host][name] = {
                         'deps': d.get('deps', []),
                         'last_config': str_to_datetime(d['last_config']),
@@ -1572,6 +1576,9 @@ class HostCache():
         if host in self.daemons:
             if name in self.daemons[host]:
                 del self.daemons[host][name]
+        if host in self.daemon_config_deps:
+            if name in self.daemon_config_deps[host]:
+                del self.daemon_config_deps[host][name]
 
     def daemon_cache_filled(self) -> bool:
         """