Skip to content

Commit

Permalink
osd/OSDMap: skip out/crush-out osds
Browse files Browse the repository at this point in the history
We might do 'ceph osd out <osd.x>' or 'ceph osd crush reweight <osd.x> 0'
for various reasons, and hence can produce 0-weighted OSDs.
Skip those OSDs when trying to calculdate PG upmaps so we won't be able to
hit the *assert* below:

/build/ceph-13.0.1-2232-g64665c7/src/osd/OSDMap.cc: 4179: FAILED assert(target > 0)

See also:

http://pulpito.ceph.com/xxg-2018-02-28_09:02:53-rados-wip-fix-upmap-distro-basic-smithi/2235497/

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 1f78ca2)
  • Loading branch information
xiexingguo committed Mar 12, 2018
1 parent eb3c67f commit 621a379
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/osd/OSDMap.cc
Expand Up @@ -3872,6 +3872,9 @@ int OSDMap::calc_pg_upmaps(
ldout(cct,30) << __func__ << " pool " << i.first << " ruleno " << ruleno << dendl;
for (auto p : pmap) {
auto adjusted_weight = tmp.get_weightf(p.first) * p.second;
if (adjusted_weight == 0) {
continue;
}
osd_weight[p.first] += adjusted_weight;
osd_weight_total += adjusted_weight;
}
Expand Down

0 comments on commit 621a379

Please sign in to comment.