]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: speedup _refresh_hosts_and_daemons by 10x
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 19 Jun 2020 15:27:58 +0000 (17:27 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 14 Jul 2020 09:39:06 +0000 (11:39 +0200)
by calling 10 hosts in parallel.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit 0716b0556996ce34b628611274064cbf05fef97c)

src/pybind/mgr/cephadm/module.py

index d3416ec03ea0d0a51896a4a346527f41853f865b..5675912f16262223b6168142316fab7c7d0cdad0 100644 (file)
@@ -1123,7 +1123,9 @@ you may want to run:
     def _refresh_hosts_and_daemons(self):
         bad_hosts = []
         failures = []
-        for host in self.cache.get_hosts():
+
+        @forall_hosts
+        def refresh(host):
             if self.cache.host_needs_check(host):
                 r = self._check_host(host)
                 if r is not None:
@@ -1144,7 +1146,8 @@ you may want to run:
                 r = self._refresh_host_osdspec_previews(host)
                 if r:
                     failures.append(r)
-
+                    
+        refresh(self.cache.get_hosts())
 
         health_changed = False
         if 'CEPHADM_HOST_CHECK_FAILED' in self.health_checks: