]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/balancer/module.py: assign weight-sets to all buckets before balancing 40127/head
authorNeha Ojha <nojha@redhat.com>
Tue, 9 Mar 2021 00:48:58 +0000 (00:48 +0000)
committerNeha Ojha <nojha@redhat.com>
Mon, 15 Mar 2021 18:05:18 +0000 (18:05 +0000)
commitae54d5d8e490e93206d0e345faafc5f9fea274c0
tree33ed4a7ab70835e39a4fed25ab14b553de49bc60
parent4db20a7386a7816fbf53ee7139cdb4ca22d9e1de
pybind/mgr/balancer/module.py: assign weight-sets to all buckets before balancing

Add an additional check to make sure that the choose_args section has the same
number of buckets as the crushmap. If not, ensure that
get_compat_weight_set_weights assigns weight-sets to all buckets.

Without this change, if we end up with an orig_ws, which has fewer buckets
than the crushmap, the mgr will crash due a KeyError in do_crush_compat().

Fixes: https://tracker.ceph.com/issues/49576
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit 42c01f0c3932f7a9157797013e5db2e03d9c1fd9)

 Conflicts:
src/pybind/mgr/balancer/module.py - trivial resolution
src/pybind/mgr/balancer/module.py