]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: consider overfull osds only when trying to do upmap 32368/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 20 Dec 2019 08:26:44 +0000 (16:26 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 20 Dec 2019 08:45:25 +0000 (16:45 +0800)
By definition, we should only upmap pgs from overfull osds to
underfull osds. Hence we could make a safe exit if we start
to hit underfull osds when searching a target osd for upmapping.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSDMap.cc

index 68788240a2f074ff32bf795b694d016821d43515..a9e72507327a7e38b0ea14a3348e371f38cfaaf0 100644 (file)
@@ -4683,6 +4683,12 @@ int OSDMap::calc_pg_upmaps(
       }
       int osd = p->second;
       float deviation = p->first;
+      if (deviation < 0) {
+        ldout(cct, 10) << " hitting underfull osds now"
+                       << " when trying to remap overfull osds"
+                       << dendl;
+        break;
+      }
       float target = osd_weight[osd] * pgs_per_weight;
       ldout(cct, 10) << " Overfull search osd." << osd
                        << " target " << target