]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: call iscsi post_remove from server loop 49847/head
authorAdam King <adking@redhat.com>
Fri, 20 Jan 2023 22:14:23 +0000 (17:14 -0500)
committerAdam King <adking@redhat.com>
Tue, 24 Jan 2023 19:10:46 +0000 (14:10 -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 178abd985d106894531f5263c5ba08560b94ec56..f5bc1770e51fea496e2bafc807aa5160fee1f960 100644 (file)
@@ -549,6 +549,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 74215a238b2f244a6f82e446ff5ba2fdd517b351..21f3c037da5d5d2a5aa56e52f6e83d262816a81b 100644 (file)
@@ -82,6 +82,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()
@@ -393,6 +395,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',
@@ -1247,8 +1253,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)