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.93~234^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3408%2Fhead;p=ceph.git mon: PGMonitor: skip zeroed osd stats on get_rule_avail() Fixes: #10257 Signed-off-by: Joao Eduardo Luis --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index ba4ba45f8a1..dc310df0a4d 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1295,6 +1295,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)