Skip to content

Commit

Permalink
Merge pull request #6907: infernalis: Ceph Pools' MAX AVAIL is 0 if s…
Browse files Browse the repository at this point in the history
…ome OSDs' weight is 0

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
Loic Dachary committed Feb 8, 2016
2 parents 4e44e42 + b211686 commit 3383522
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mon/PGMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1301,9 +1301,12 @@ int64_t PGMonitor::get_rule_avail(OSDMap& osdmap, int ruleno) const
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) {
if (osd_info->second.kb == 0 || p->second == 0) {
// osd must be out, hence its stats have been zeroed
// (unless we somehow managed to have a disk with size 0...)
//
// (p->second == 0), if osd weight is 0, no need to
// calculate proj below.
continue;
}
int64_t proj = (float)((osd_info->second).kb_avail * 1024ull) /
Expand Down

0 comments on commit 3383522

Please sign in to comment.