]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd/OSDMap: cancel mapping if target osd is out 25698/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:13:27 +0000 (20:13 +0800)
commit1c2c41d9ac9b0b88d93df3c795129fc11139a70d
tree5db94a579ab68c5edf3dd5bf83fc399bbfedfd35
parent7f094a2228ed656068da3815865f7649ac4d2cd8
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