From 7272236d1088b0f2a49f5b18811e6ab4c552f3a8 Mon Sep 17 00:00:00 2001 From: Adam King Date: Tue, 30 Jun 2026 15:31:20 -0400 Subject: [PATCH] mgr/cephadm: clear daemon_config_deps entry for removed daemons 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 --- src/pybind/mgr/cephadm/inventory.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pybind/mgr/cephadm/inventory.py b/src/pybind/mgr/cephadm/inventory.py index 7e396401e38..18e55049600 100644 --- a/src/pybind/mgr/cephadm/inventory.py +++ b/src/pybind/mgr/cephadm/inventory.py @@ -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: """ -- 2.47.3