]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: PGMonitor: skip zeroed osd stats on get_rule_avail() 4027/head
authorJoao Eduardo Luis <joao@redhat.com>
Mon, 19 Jan 2015 18:49:15 +0000 (18:49 +0000)
committerLoic Dachary <ldachary@redhat.com>
Tue, 17 Mar 2015 09:55:40 +0000 (10:55 +0100)
Fixes: #10257
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
(cherry picked from commit b311e7c36273efae39aa2602c1f8bd90d39e5975)

src/mon/PGMonitor.cc

index 34883e1f47a2a47c6eab5a28562b5aaa86a98b4c..5ae23d34a67594bd7dbaf430e7033b97903a9a29 100644 (file)
@@ -1274,6 +1274,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)