Skip to content

Commit 5485e00

Browse files
kamoltatshraddhaag
authored andcommitted
src/osd/PeeringState.cc: update last_unstale properly
Problem: When we update the `pg_stat` we don't check whether the pg state is in `stale`. Therefore, the attribute `last_unstale` will always get updated even if the pg state actually contains `stale`. Solution: Place a condition to only update the attribute `last_unstale` when we the pg truly doesn't have `stale` in its state. Fixes: https://tracker.ceph.com/issues/67777 Signed-off-by: Kamoltat <[email protected]>
1 parent cad8cd3 commit 5485e00

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/osd/PeeringState.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4240,7 +4240,8 @@ std::optional<pg_stat_t> PeeringState::prepare_stats_for_publish(
42404240
info.stats.last_active = now;
42414241
if (info.stats.state & (PG_STATE_ACTIVE|PG_STATE_PEERED))
42424242
info.stats.last_peered = now;
4243-
info.stats.last_unstale = now;
4243+
if ((info.stats.state & PG_STATE_STALE) == 0)
4244+
info.stats.last_unstale = now;
42444245
if ((info.stats.state & PG_STATE_DEGRADED) == 0)
42454246
info.stats.last_undegraded = now;
42464247
if ((info.stats.state & PG_STATE_UNDERSIZED) == 0)

0 commit comments

Comments
 (0)