]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/pg_autoscaler: fix warn when not too few pgs 53675/head
authorKamoltat <ksirivad@redhat.com>
Mon, 5 Jun 2023 17:17:32 +0000 (17:17 +0000)
committerKamoltat <ksirivad@redhat.com>
Tue, 26 Sep 2023 14:48:44 +0000 (14:48 +0000)
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 <ksirivad@redhat.com>
(cherry picked from commit bfef56701f576d1a62017d313839a0c36949ac00)

src/pybind/mgr/pg_autoscaler/module.py

index ae7ebf09441f8c7fc02129131f8a92c0b56df8d3..a1827042b10fde92bec55c8f3ac9f378b40f371a 100644 (file)
@@ -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