]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/autoscaler: don't scale pools with overlapping roots 42036/head
authorKamoltat <ksirivad@redhat.com>
Fri, 25 Jun 2021 22:40:43 +0000 (22:40 +0000)
committerKamoltat <ksirivad@redhat.com>
Thu, 8 Jul 2021 21:05:25 +0000 (21:05 +0000)
commit16eb42a1d8cef5cf008b04b27d51e13dbd6ec495
tree09c42f3e2de8e49cce2b93facce6908a31ba2771
parent0509deb6a895a98e3e582cbb849606bc559b963c
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>
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]