]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: do not consider changing pg stuck 35871/head
authorKefu Chai <kchai@redhat.com>
Wed, 1 Jul 2020 11:33:35 +0000 (19:33 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 1 Jul 2020 11:39:35 +0000 (19:39 +0800)
there is chance that we have a PG just created but fails to peered
before a mgr module retrieves the health report from mgr. in that
case, the "last_peered" field is not set, as that pg has not peered. but
normally, the newly created PG will be active+clean in couple seconds
which is way under the default setting of mon_pg_stuck_threshold (60
seconds).

so in this change, if the "last_whatever" is not set, we also use the
"last_changed" as a reference to see if the PG is healthy, and only
consider PG stuck if the last_changed is also too old.

Fixes: https://tracker.ceph.com/issues/45717
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/PGMap.cc

index 24af54ba0ccaad47b457062a88e2f04483682b71..5ba3a469e8c77fb9349127b50a66726854388fc7 100644 (file)
@@ -2527,7 +2527,11 @@ void PGMap::get_health_checks(
         if (pg_response.stuck_since) {
           // Delayed response, check for stuckness
           utime_t last_whatever = pg_response.stuck_since(pg_info);
-          if (last_whatever >= cutoff) {
+          if (last_whatever.is_zero() &&
+            pg_info.last_change >= cutoff) {
+            // still moving, ignore
+            continue;
+          } else if (last_whatever >= cutoff) {
             // Not stuck enough, ignore.
             continue;
           } else {