]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap.cc: move sanity checks to the proper place 22630/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 20 Jun 2018 01:27:46 +0000 (09:27 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 20 Jun 2018 01:27:46 +0000 (09:27 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSDMap.cc

index 798b7fa1e296effa3efd577b41ed22c17820934c..67bb651ec63d9ee1bf226305b7badc95438c26a6 100644 (file)
@@ -4222,6 +4222,8 @@ int OSDMap::calc_pg_upmaps(
     multimap<float,int> deviation_osd;  // deviation(pgs), osd
     set<int> 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) {