]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: call iscsi post_remove from server loop 49928/head
authorAdam King <adking@redhat.com>
Fri, 20 Jan 2023 22:14:23 +0000 (17:14 -0500)
committerAdam King <adking@redhat.com>
Mon, 30 Jan 2023 23:33:01 +0000 (18:33 -0500)
If we call it directly during a synchronous command
from the command line it never returns.

Fixes: https://tracker.ceph.com/issues/58531
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit ea38245ace58789216646262f2078a315f1d2fd5)

src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/serve.py

index 9fc4298a868a30db926794d479012cddc79f0178..f3d80749c7fb3bd051e6cdb81e6c855d58e0b06a 100644 (file)
@@ -496,6 +496,8 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
         self.osd_service: OSDService = cast(OSDService, self.cephadm_services['osd'])
         self.iscsi_service: IscsiService = cast(IscsiService, self.cephadm_services['iscsi'])
 
+        self.scheduled_async_actions: List[Callable] = []
+
         self.template = TemplateMgr(self)
 
         self.requires_post_actions: Set[str] = set()
index 7ac6fee88e2cd476722cd7132ea9de58646888c3..a0f86ed415ad31aa18db5d8be8abdd106ee75590 100644 (file)
@@ -90,6 +90,8 @@ class CephadmServe:
                         self.mgr.remote('dashboard', 'set_rgw_credentials')
 
                 if not self.mgr.paused:
+                    self._run_async_actions()
+
                     self.mgr.to_remove_osds.process_removal_queue()
 
                     self.mgr.migration.migrate()
@@ -417,6 +419,10 @@ class CephadmServe:
         # Unset global 'pending' flag for host
         self.mgr.cache.loading_osdspec_preview.remove(search_host)
 
+    def _run_async_actions(self) -> None:
+        while self.mgr.scheduled_async_actions:
+            (self.mgr.scheduled_async_actions.pop(0))()
+
     def _check_for_strays(self) -> None:
         self.log.debug('_check_for_strays')
         for k in ['CEPHADM_STRAY_HOST',
@@ -1207,8 +1213,13 @@ class CephadmServe:
             self.mgr.cache.invalidate_host_daemons(host)
 
             if not no_post_remove:
-                self.mgr.cephadm_services[daemon_type_to_service(
-                    daemon_type)].post_remove(daemon, is_failed_deploy=False)
+                if daemon_type not in ['iscsi']:
+                    self.mgr.cephadm_services[daemon_type_to_service(
+                        daemon_type)].post_remove(daemon, is_failed_deploy=False)
+                else:
+                    self.mgr.scheduled_async_actions.append(lambda: self.mgr.cephadm_services[daemon_type_to_service(
+                                                            daemon_type)].post_remove(daemon, is_failed_deploy=False))
+                    self.mgr._kick_serve_loop()
 
             return "Removed {} from host '{}'".format(name, host)