From: Sage Weil Date: Tue, 23 Nov 2021 23:59:28 +0000 (-0500) Subject: mgr/cephadm: skip osd_stats check if osd removal queue is empty X-Git-Tag: v16.2.8~273^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1c21204760c4e28fec0f48e5a0dc83da1d6566ce;p=ceph.git mgr/cephadm: skip osd_stats check if osd removal queue is empty Signed-off-by: Sage Weil (cherry picked from commit 0bbbe5d31d834d5626c11fd9c49b572b111ead8f) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b61cc54df068..d2cc4050c4da 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -559,12 +559,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