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: v17.1.0~364^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0bbbe5d31d834d5626c11fd9c49b572b111ead8f;p=ceph-ci.git mgr/cephadm: skip osd_stats check if osd removal queue is empty Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index db7568a3e98..b28a82a0887 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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