From: xie xingguo Date: Wed, 20 Jun 2018 01:27:46 +0000 (+0800) Subject: osd/OSDMap.cc: move sanity checks to the proper place X-Git-Tag: v14.0.1~1044^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22630%2Fhead;p=ceph.git osd/OSDMap.cc: move sanity checks to the proper place Signed-off-by: xie xingguo --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 798b7fa1e296..67bb651ec63d 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -4222,6 +4222,8 @@ int OSDMap::calc_pg_upmaps( multimap deviation_osd; // deviation(pgs), osd set overfull; for (auto& i : pgs_by_osd) { + // make sure osd is still there (belongs to this crush-tree) + assert(osd_weight.count(i.first)); float target = osd_weight[i.first] * pgs_per_weight; float deviation = (float)i.second.size() - target; ldout(cct, 20) << " osd." << i.first @@ -4260,8 +4262,6 @@ int OSDMap::calc_pg_upmaps( for (auto p = deviation_osd.rbegin(); p != deviation_osd.rend(); ++p) { int osd = p->second; float deviation = p->first; - // make sure osd is still there (belongs to this crush-tree) - assert(osd_weight.count(osd)); float target = osd_weight[osd] * pgs_per_weight; assert(target > 0); if (deviation/target < max_deviation_ratio) {