From 1816e7bb62265dbff65bba082f3ff67052d7ce5a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 23 Jan 2020 21:13:58 -0600 Subject: [PATCH] mgr/pg_autoscaler: don't check anything until cluster is nautilus This prevents any health alerts about too many/few PGs due to old pools that are defaulted to 'warn'. Signed-off-by: Sage Weil --- src/pybind/mgr/mgr_module.py | 4 ++++ src/pybind/mgr/pg_autoscaler/module.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index 11e965fbda2..48163be8c5e 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -150,6 +150,10 @@ class OSDMap(ceph_module.BasePyOSDMap): d = self._dump() return d['erasure_code_profiles'].get(name, None) + def get_require_osd_release(self): + d = self._dump() + return d['require_osd_release'] + class OSDMapIncremental(ceph_module.BasePyOSDMapIncremental): def get_epoch(self): diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index e50860edbe1..36bd4cb1053 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -383,6 +383,8 @@ class PgAutoscaler(MgrModule): def _maybe_adjust(self): self.log.info('_maybe_adjust') osdmap = self.get_osdmap() + if osdmap.get_require_osd_release() < 'nautilus': + return pools = osdmap.get_pools_by_name() ps, root_map, pool_root = self._get_pool_status(osdmap, pools) -- 2.39.5