From: Sage Weil Date: Thu, 14 Nov 2019 15:48:24 +0000 (-0600) Subject: mgr/pg_autoscaler: only generate target_* health warnings if targets set X-Git-Tag: v15.1.0~839^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4e5c4cdeb4e88d034e2fed7d6de97a4322a57adc;p=ceph-ci.git 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 --- 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' % (