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 <ksirivad@redhat.com>
info.stats.last_active = now;
if (info.stats.state & (PG_STATE_ACTIVE|PG_STATE_PEERED))
info.stats.last_peered = now;
- info.stats.last_unstale = now;
+ if ((info.stats.state & PG_STATE_STALE) == 0)
+ info.stats.last_unstale = now;
if ((info.stats.state & PG_STATE_DEGRADED) == 0)
info.stats.last_undegraded = now;
if ((info.stats.state & PG_STATE_UNDERSIZED) == 0)