]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/OSDMap.cc: remove pg_upmap/pg_upmap_items too if osd is gone
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 20 Jun 2018 01:04:19 +0000 (09:04 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 6 Dec 2018 02:16:17 +0000 (10:16 +0800)
commit771bc194c4579e6bbe5993c6475a832a61df5723
tree715b463cb3c0261badf4ee418d2adaf5a1492abc
parent5e2a4bf731c2a02f4afa4da597c4954437d14a87
osd/OSDMap.cc: remove pg_upmap/pg_upmap_items too if osd is gone

If an osd is gone or moved out from the specific crush rule,
we should cancel any pg_upmap/pg_upmap_items still bound to
that osd too.

The original code does not work for the above case because
get_parent_of_type() will fail if that osd does not belong
to the crush_rule passed in and hence hits the assert below:

```
src/osd/OSDMap.cc: 4078: FAILED assert(target > 0)
```

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 8a11ed479d7ea95f76170e74123ca2c48e3a3963)
src/osd/OSDMap.cc