]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: PGMonitor: skip zeroed osd stats on get_rule_avail() 3826/head
authorJoao Eduardo Luis <joao@redhat.com>
Mon, 19 Jan 2015 18:49:15 +0000 (18:49 +0000)
committerLoic Dachary <ldachary@redhat.com>
Fri, 27 Feb 2015 17:39:29 +0000 (18:39 +0100)
Fixes: #10257
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
(cherry picked from commit b311e7c36273efae39aa2602c1f8bd90d39e5975)

Conflicts:
src/mon/PGMonitor.cc
        ceph::unordered_map changed the context, simple resolution

src/mon/PGMonitor.cc

index 9a4aee36ae20c16d80acdaa94c63d4fb90f52600..3e0523bba898dcfcb9bb5dd93c7e5e8898a446d9 100644 (file)
@@ -1258,6 +1258,11 @@ int64_t PGMonitor::get_rule_avail(OSDMap& osdmap, int ruleno)
     return 0;
   int64_t min = -1;
   for (map<int,float>::iterator p = wm.begin(); p != wm.end(); ++p) {
+    if (pg_map.osd_stat[p->first].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)(pg_map.osd_stat[p->first].kb_avail * 1024ull) /
       (double)p->second;
     if (min < 0 || proj < min)