]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/autoscaler: don't scale pools with overlapping roots
authorKamoltat <ksirivad@redhat.com>
Fri, 25 Jun 2021 22:40:43 +0000 (22:40 +0000)
committerKamoltat <ksirivad@redhat.com>
Thu, 26 Aug 2021 19:56:44 +0000 (19:56 +0000)
commita29565511b206f67975c266e7a9ec5b8d00cd5e3
treed0862f4f0136d13cc24ee1b2eb90e6d0ff974a00
parent83b926119d1483d60d2470311027b821b4a4f324
pybind/mgr/autoscaler: don't scale pools with overlapping roots

In the previous version of get_subtree_resource_status() in
src/pybind/mgr/pg_autoscaler/module.py we ignore overlapping
pools which in some cases if combined with the new `scale-down`
algorithm in https://github.com/ceph/ceph/pull/38805 can cause
some pools to scale up/down to inapproriate amount of pgs.

Therefore, the PR identifies the overlapping roots and prevent the pools
with such roots from scaling. This only happens with `scale-down` profile
as we see no problem with the default `scale-up` profile.

Removed the variable `pool_root` since it is not used anywhere in
the code, it only gets assigned and reassigned

Also included a unit test test_overlapping_roots.py that tests the function
identify_subtrees_and_overlaps() as well as edited test_cal_final_pg_target.py
to account for pools that contain overlapping roots, therefore, those pools
are expected not to scale.

Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit 16eb42a1d8cef5cf008b04b27d51e13dbd6ec495)
src/pybind/mgr/pg_autoscaler/module.py
src/pybind/mgr/pg_autoscaler/tests/test_cal_final_pg_target.py
src/pybind/mgr/pg_autoscaler/tests/test_cal_ratio.py
src/pybind/mgr/pg_autoscaler/tests/test_overlapping_roots.py [new file with mode: 0644]