From 4e5c4cdeb4e88d034e2fed7d6de97a4322a57adc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 14 Nov 2019 09:48:24 -0600 Subject: [PATCH] mgr/pg_autoscaler: only generate target_* health warnings if targets set We may get into a situation where the pool stats appear to exceed the cluster capacity. If that happens, don't generate confusing health messages about the target_{ratio,bytes} pool settings when they aren't actually set at all. Fixes: https://tracker.ceph.com/issues/42301 Signed-off-by: Sage Weil --- src/pybind/mgr/pg_autoscaler/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index 345fc7e1860..0e397bb9d75 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -491,7 +491,7 @@ class PgAutoscaler(MgrModule): too_much_target_ratio = [] for root_id, total in iteritems(total_ratio): total_target = total_target_ratio[root_id] - if total > 1.0: + if total_target > 0 and total > 1.0: too_much_target_ratio.append( 'Pools %s overcommit available storage by %.03fx due to ' 'target_size_ratio %.03f on pools %s' % ( @@ -519,7 +519,7 @@ class PgAutoscaler(MgrModule): too_much_target_bytes = [] for root_id, total in iteritems(total_bytes): total_target = total_target_bytes[root_id] - if total > root_map[root_id].capacity: + if total_target > 0 and total > root_map[root_id].capacity: too_much_target_bytes.append( 'Pools %s overcommit available storage by %.03fx due to ' 'target_size_bytes %s on pools %s' % ( -- 2.39.5