Skip to content

Commit

Permalink
Merge pull request #14391 from LiumxNL/wip-170407
Browse files Browse the repository at this point in the history
mon/PGMonitor: fix wrongly report "pg stuck in inactive"

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Apr 28, 2017
2 parents 2944c48 + 77b0ff4 commit e9fb6a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mon/PGMap.cc
Expand Up @@ -539,6 +539,13 @@ void PGMap::stat_pg_update(const pg_t pgid, pg_stat_t& s,
s.blocked_by == n.blocked_by;

stat_pg_sub(pgid, s, sameosds);

// if acting_primary has shift to an just restored osd, and pg yet to finish
// peering, many attributes in current stats remain stale. others seem don't
// mater much while faulty last_active will make "pg stuck in" check unhappy.
if (!(n.state & (PG_STATE_ACTIVE | PG_STATE_PEERED)) &&
n.last_active < s.last_active)
n.last_active = s.last_active;
s = n;
stat_pg_add(pgid, n, sameosds);
}
Expand Down

0 comments on commit e9fb6a0

Please sign in to comment.