]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: PGMonitor: skip zeroed osd stats on get_rule_avail() 3408/head
authorJoao Eduardo Luis <joao@redhat.com>
Mon, 19 Jan 2015 18:49:15 +0000 (18:49 +0000)
committerJoao Eduardo Luis <joao@redhat.com>
Tue, 20 Jan 2015 16:18:44 +0000 (16:18 +0000)
Fixes: #10257
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
src/mon/PGMonitor.cc

index ba4ba45f8a18745fa6a1c17de72059d43881b2b3..dc310df0a4d5be72a4e3bc56b7fbf757c6f3b6aa 100644 (file)
@@ -1295,6 +1295,11 @@ int64_t PGMonitor::get_rule_avail(OSDMap& osdmap, int ruleno)
   for (map<int,float>::iterator p = wm.begin(); p != wm.end(); ++p) {
     ceph::unordered_map<int32_t,osd_stat_t>::const_iterator osd_info = pg_map.osd_stat.find(p->first);
     if (osd_info != pg_map.osd_stat.end()) {
+      if (osd_info->second.kb == 0) {
+        // osd must be out, hence its stats have been zeroed
+        // (unless we somehow managed to have a disk with size 0...)
+        continue;
+      }
       int64_t proj = (float)((osd_info->second).kb_avail * 1024ull) /
         (double)p->second;
       if (min < 0 || proj < min)