]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PGMonitor: fix wrongly report "pg stuck in inactive" 14391/head
authorMingxin Liu <mingxin@xsky.com>
Fri, 7 Apr 2017 10:20:18 +0000 (18:20 +0800)
committerMingxin Liu <mingxin@xsky.com>
Wed, 26 Apr 2017 04:29:34 +0000 (12:29 +0800)
Signed-off-by: Mingxin Liu <mingxin@xsky.com>
src/mon/PGMap.cc

index 8b4a1010ab265e611a2330e738df6812c5565aff..6150f0d003ee9d892a8b85249dae1527c7ef1fc9 100644 (file)
@@ -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);
 }