]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/OSDMap: cancel mapping if target osd is out 25630/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 19 Dec 2018 09:01:23 +0000 (17:01 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 19 Dec 2018 10:03:53 +0000 (18:03 +0800)
commitd06b65a0ab210e7a920761765531d929dd5798ec
tree110379ec0fc51b6bf3dec033d86f259667a624f2
parentb5f33ae3722118ec07112a4fe1bb0bdedb803a60
osd/OSDMap: cancel mapping if target osd is out

Suppose we have a bad pg_upmap_item, say:
```
pg_upmap_items 2.0 [0,8,5,4,6,12]
```
which maps osd.6 to osd.12 that is currently marked as out.

It turns out **maybe_remove_pg_upmaps** can not handle the
above case well because **_apply_upmap** will silently discard
any bad mappings whenver they try to target at some current
__out__ OSDs. So if you call **pg_to_raw_up(2.0)**, you'll probably
get something like: ```up [8,4,6] ``` (e.g., the last mapping pair 6->12
is simply ignored by **_apply_upmap**).

Make **clean_pg_upmaps** do the tidy-up check instead, since it
already has __bare__ access to those pg_upmaps and pg_upmap_items.

Fixes: http://tracker.ceph.com/issues/37501
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
Signed-off-by: ningtao <ningtao@sangfor.com.cn>
src/osd/OSDMap.cc
src/test/osd/TestOSDMap.cc