From 0bbbe5d31d834d5626c11fd9c49b572b111ead8f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 23 Nov 2021 18:59:28 -0500 Subject: [PATCH] mgr/cephadm: skip osd_stats check if osd removal queue is empty Signed-off-by: Sage Weil --- src/pybind/mgr/cephadm/module.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index db7568a3e980f..b28a82a0887a0 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 -- 2.47.3