]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/pg_autoscaler: Reorderd if statement for the func: _maybe_adjust
authorKamoltat <ksirivad@redhat.com>
Wed, 1 Mar 2023 20:32:47 +0000 (20:32 +0000)
committerKamoltat <ksirivad@redhat.com>
Mon, 27 Mar 2023 19:15:47 +0000 (19:15 +0000)
commit04fcf3030c9d6d520a391b2176add93e6b6b6cb2
treef394ca73927a5e532a67a74fc6de5370ec9c8e87
parent85b190664e35fe58350f24ddfc2d9737b40e5895
pybind/mgr/pg_autoscaler: Reorderd if statement for the func: _maybe_adjust

Problem:

In the func `_maybe_adjust` we have this condition
where `if not p['would_adjust']: continue` which
would get triggered before `if p['pg_autoscale_mode'] == 'warn':`
if we don't have `pg_autoscale_mode` as `on`. This causes:
the autoscaler to not throw any warnings.

Solution:
Move `if p['pg_autoscale_mode'] == 'warn':` to be
higher than `if not p['would_adjust']: continue`.

Fixes: https://tracker.ceph.com/issues/58894
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit c43fe7f07631bd0d795b711a100b9220b996ace0)
src/pybind/mgr/pg_autoscaler/module.py