]> 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>
Tue, 12 Sep 2023 17:31:15 +0000 (17:31 +0000)
commitcf2aeae3645be23ddc3b89af2a3a3e635c9cbb14
tree451f45eda4d3dd2178a2db5f72eef32124cf022b
parentd43c368afe903008b0a317770cc545a1bd7f19b8
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