]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: track daemon deployment post actions by daemon name instead of type
authorDaniel Pivonka <dpivonka@redhat.com>
Thu, 7 Oct 2021 19:52:05 +0000 (15:52 -0400)
committerDaniel Pivonka <dpivonka@redhat.com>
Fri, 8 Oct 2021 14:50:19 +0000 (10:50 -0400)
in rare cases tracking by type can cause a daemon to be missed when doing post actions if it is not in the cache yet

Signed-off-by: Daniel Pivonka <dpivonka@redhat.com>
src/pybind/mgr/cephadm/serve.py

index 1cf024fac310a9889b8df62223844840e9e4b6ea..59191999532c2704ba29ec824ed37632a4779b6f 100644 (file)
@@ -1004,8 +1004,12 @@ class CephadmServe:
 
         # do daemon post actions
         for daemon_type, daemon_descs in daemons_post.items():
-            if daemon_type in self.mgr.requires_post_actions:
-                self.mgr.requires_post_actions.remove(daemon_type)
+            run_post = False
+            for d in daemon_descs:
+                if d.name() in self.mgr.requires_post_actions:
+                    self.mgr.requires_post_actions.remove(d.name())
+                    run_post = True
+            if run_post:
                 self.mgr._get_cephadm_service(daemon_type_to_service(
                     daemon_type)).daemon_check_post(daemon_descs)
 
@@ -1125,7 +1129,7 @@ class CephadmServe:
                             DaemonDescriptionStatus.running, 'starting')
                         self.mgr.cache.add_daemon(daemon_spec.host, sd)
                         if daemon_spec.daemon_type in REQUIRES_POST_ACTIONS:
-                            self.mgr.requires_post_actions.add(daemon_spec.daemon_type)
+                            self.mgr.requires_post_actions.add(daemon_spec.name())
                     self.mgr.cache.invalidate_host_daemons(daemon_spec.host)
 
                 self.mgr.cache.update_daemon_config_deps(