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)