]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd/OSDMap: cancel mapping if target osd is out 25699/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>
Tue, 25 Dec 2018 12:17:17 +0000 (20:17 +0800)
commit5a722b7ddc06576f350c134939d76279bba3896b
tree0ad8544e94ddfcd3a410987f8cb1e1857f0f6956
parenta64198e24492cde465cb3235813a30945003456a
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>
(cherry picked from commit d06b65a0ab210e7a920761765531d929dd5798ec)

Conflicts:
        - *maybe_remove_pg_upmaps* input changed, in master
          we now have a passed in *nextmap* parameter
src/osd/OSDMap.cc
src/test/osd/TestOSDMap.cc