]> git.apps.os.sepia.ceph.com Git - ceph.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)
committerSebastian Wagner <sewagner@redhat.com>
Wed, 17 Nov 2021 10:25:57 +0000 (11:25 +0100)
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>
(cherry picked from commit 008b41bfc7a80d215314ece61af9291094e3f274)

src/pybind/mgr/cephadm/serve.py

index acbdd9af53ad79a28fd57dcc67213f8c56b5a4c8..35092793a3339f6999d174cd7e3c883925a85edd 100644 (file)
@@ -942,8 +942,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)
 
@@ -1065,7 +1069,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(