]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: scheduler: make use of ok-to-stop
authorSebastian Wagner <sebastian.wagner@suse.com>
Tue, 9 Jun 2020 12:57:48 +0000 (14:57 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 14 Jul 2020 09:39:06 +0000 (11:39 +0200)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit f42182587057e8e18661f0b7570c7af1617e3506)

src/pybind/mgr/cephadm/module.py
src/pybind/mgr/orchestrator/_interface.py

index 1963a69b606ad5d4882e0c1ea922a6716e5bdbb0..9160a2cde0407a288c256b67504368aaba52e102 100644 (file)
@@ -1839,6 +1839,10 @@ you may want to run:
             r = True
 
         # remove any?
+        while remove_daemon_hosts and not self.cephadm_services[daemon_type].ok_to_stop(
+                [d.daemon_id for d in remove_daemon_hosts]):
+            # let's find a subset that is ok-to-stop
+            remove_daemon_hosts.pop()
         for d in remove_daemon_hosts:
             # NOTE: we are passing the 'force' flag here, which means
             # we can delete a mon instances data.
index 9eac046a07dbffe7bbae552c0e628987eab1af81..7de5c00d6caa6366341308afaf13f252083d43e4 100644 (file)
@@ -1238,7 +1238,7 @@ class DaemonDescription(object):
         # typically either based on hostnames or on pod names.
         # This is the <foo> in mds.<foo>, the ID that will appear
         # in the FSMap/ServiceMap.
-        self.daemon_id = daemon_id
+        self.daemon_id: str = daemon_id
 
         # Service version that was deployed
         self.version = version