]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/OSDMap: calc_pg_upmaps - restrict optimization to origin pools only
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 23 Mar 2019 01:50:27 +0000 (09:50 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 28 Mar 2019 02:29:50 +0000 (10:29 +0800)
commit3d2945dd6eeb857596765ccc63cb39b8e6baf6d9
tree7aef5602edfdb8ba204d1f3ef6f0d657fb93f2d6
parentab2dbc20893c99e26ba365823ed68b96f03f0f37
osd/OSDMap: calc_pg_upmaps - restrict optimization to origin pools only

The current implementation will try to cancel any pg_upmaps that
would otherwise re-map a PG out from an underfull osd, which is wrong,
e.g., because it could reliably fire the following assert:

src/osd/OSDMap.cc: 4405: FAILED assert(osd_weight.count(i.first))

Also it would not match the expectation if automatic balancing
has been strictly restricted to some specific pools by admin.

Fix by excluding any wild PG that does not belong to the origin pools
passed in when trying to do upmap/unmap.

Fixes: http://tracker.ceph.com/issues/38897
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 01e8e9482ce7194d347e02ef41acfa6d8d14f614)
src/osd/OSDMap.cc
src/test/osd/TestOSDMap.cc