]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: skip osd_stats check if osd removal queue is empty 44079/head
authorSage Weil <sage@newdream.net>
Tue, 23 Nov 2021 23:59:28 +0000 (18:59 -0500)
committerSage Weil <sage@newdream.net>
Tue, 23 Nov 2021 23:59:28 +0000 (18:59 -0500)
Signed-off-by: Sage Weil <sage@newdream.net>
src/pybind/mgr/cephadm/module.py

index db7568a3e980fead33035601414d80c473cf773e..b28a82a0887a0bb1293231850be3d29f89226325 100644 (file)
@@ -587,12 +587,15 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             self._trigger_osd_removal()
 
     def _trigger_osd_removal(self) -> None:
+        remove_queue = self.to_remove_osds.as_osd_ids()
+        if not remove_queue:
+            return
         data = self.get("osd_stats")
         for osd in data.get('osd_stats', []):
             if osd.get('num_pgs') == 0:
                 # if _ANY_ osd that is currently in the queue appears to be empty,
                 # start the removal process
-                if int(osd.get('osd')) in self.to_remove_osds.as_osd_ids():
+                if int(osd.get('osd')) in remove_queue:
                     self.log.debug('Found empty osd. Starting removal process')
                     # if the osd that is now empty is also part of the removal queue
                     # start the process