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.87.2~40^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a5a76f81ae9242a54d6ef150fa0ac32b31e90c25;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) --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 34883e1f47a2a..5ae23d34a6759 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1274,6 +1274,11 @@ int64_t PGMonitor::get_rule_avail(OSDMap& osdmap, int ruleno) for (map::iterator p = wm.begin(); p != wm.end(); ++p) { ceph::unordered_map::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)