Skip to content

Commit

Permalink
mon/PGMap: PGs can be stuck more than one thing
Browse files Browse the repository at this point in the history
This was inadvertantly changed waaay back in
9c95bb0.

This fixes the health warnings so that they are
complete and (most importantly) consistent with the
results of 'pg dump_stuck ...'.

Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Oct 5, 2016
1 parent 85224ae commit e486941
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/mon/PGMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1046,20 +1046,23 @@ bool PGMap::get_stuck_counts(const utime_t cutoff, map<string, int>& note) const
for (ceph::unordered_map<pg_t, pg_stat_t>::const_iterator i = pg_stat.begin();
i != pg_stat.end();
++i) {

if (! (i->second.state & PG_STATE_ACTIVE)) {
if (i->second.last_active < cutoff)
++inactive;
} else if (! (i->second.state & PG_STATE_CLEAN)) {
}
if (! (i->second.state & PG_STATE_CLEAN)) {
if (i->second.last_clean < cutoff)
++unclean;
} else if (i->second.state & PG_STATE_DEGRADED) {
}
if (i->second.state & PG_STATE_DEGRADED) {
if (i->second.last_undegraded < cutoff)
++degraded;
} else if (i->second.state & PG_STATE_UNDERSIZED) {
}
if (i->second.state & PG_STATE_UNDERSIZED) {
if (i->second.last_fullsized < cutoff)
++undersized;
} else if (i->second.state & PG_STATE_STALE) {
}
if (i->second.state & PG_STATE_STALE) {
if (i->second.last_unstale < cutoff)
++stale;
}
Expand Down

0 comments on commit e486941

Please sign in to comment.