Skip to content

Commit 0b61c86

Browse files
authored
Merge pull request ceph#49332 from shreyanshjain7174/stuck_peering
mon: stuck peering since warning is misleading Reviewed-by: Kamoltat (Junior) Sirivadhna <[email protected]>
2 parents bace1df + 48a8a6c commit 0b61c86

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/mon/PGMap.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,6 +1941,10 @@ void PGMap::get_stuck_stats(
19411941
val = i->second.last_unstale;
19421942
}
19431943

1944+
if ((types & STUCK_PEERING) && (i->second.state & PG_STATE_PEERING)) {
1945+
if (i->second.last_peered < val)
1946+
val = i->second.last_peered;
1947+
}
19441948
// val is now the earliest any of the requested stuck states began
19451949
if (val < cutoff) {
19461950
stuck_pgs[i->first] = i->second;
@@ -1991,6 +1995,8 @@ int PGMap::dump_stuck_pg_stats(
19911995
stuck_types |= PGMap::STUCK_DEGRADED;
19921996
else if (*i == "stale")
19931997
stuck_types |= PGMap::STUCK_STALE;
1998+
else if (*i == "peering")
1999+
stuck_types |= PGMap::STUCK_PEERING;
19942000
else {
19952001
ds << "Unknown type: " << *i << std::endl;
19962002
return -EINVAL;
@@ -3852,6 +3858,7 @@ static void _try_mark_pg_stale(
38523858
newstat->state |= PG_STATE_STALE;
38533859
newstat->last_unstale = ceph_clock_now();
38543860
}
3861+
38553862
}
38563863

38573864
void PGMapUpdater::check_down_pgs(

src/mon/PGMap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ class PGMap : public PGMapDigest {
359359
static const int STUCK_UNDERSIZED = (1<<2);
360360
static const int STUCK_DEGRADED = (1<<3);
361361
static const int STUCK_STALE = (1<<4);
362-
362+
static const int STUCK_PEERING = (1<<5);
363+
363364
PGMap()
364365
: version(0),
365366
last_osdmap_epoch(0), last_pg_scan(0)

0 commit comments

Comments
 (0)