From: Kamoltat Date: Mon, 5 Jun 2023 17:17:32 +0000 (+0000) Subject: pybind/mgr/pg_autoscaler: fix warn when not too few pgs X-Git-Tag: v18.2.1~72^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0206a085dd985c839b351b8cf5a3d6a969b769f7;p=ceph-ci.git pybind/mgr/pg_autoscaler: fix warn when not too few pgs Problem: when `pg_num_final` is equal to `pg_num_target` we get too many PGs warnings in ceph health while `warn` mode in the autoscaler. Solution: Get rid of `else` condition and add an `elif p['pg_num_final'] < p['pg_num_target']` instead Fixes: https://tracker.ceph.com/issues/61570 Signed-off-by: Kamoltat (cherry picked from commit bfef56701f576d1a62017d313839a0c36949ac00) --- diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index 13e1cff9e88..ca6ca76c4b7 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -726,7 +726,7 @@ class PgAutoscaler(MgrModule): p['pg_num_final']) if p['pg_num_final'] > p['pg_num_target']: too_few.append(msg) - else: + elif p['pg_num_final'] < p['pg_num_target']: too_many.append(msg) if not p['would_adjust']: continue