]> 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:10:27 +0000 (10:10 +0800)
commite2691869c20aff34a61ed7b2b51a283cfb180f27
treeffbb4dd6e18fa2c21f81eeb31d7d567c7ce80b6d
parent2175726cd2416fb7d653e47c6c37b7f8131318c4
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