From: Joao Eduardo Luis Date: Mon, 19 Jan 2015 18:49:15 +0000 (+0000) Subject: mon: PGMonitor: skip zeroed osd stats on get_rule_avail() X-Git-Tag: v0.80.10~73^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6e58732f546ec6241b198d2473902d66327cdc36;p=ceph.git mon: PGMonitor: skip zeroed osd stats on get_rule_avail() Fixes: #10257 Signed-off-by: Joao Eduardo Luis (cherry picked from commit b311e7c36273efae39aa2602c1f8bd90d39e5975) Conflicts: src/mon/PGMonitor.cc ceph::unordered_map changed the context, simple resolution --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 9a4aee36ae2..3e0523bba89 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1258,6 +1258,11 @@ int64_t PGMonitor::get_rule_avail(OSDMap& osdmap, int ruleno) return 0; int64_t min = -1; for (map::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)