From: Aishwarya Mathuria Date: Fri, 1 Aug 2025 10:11:02 +0000 (+0000) Subject: crimson/osd/scrub: check if stats have been marked invalid X-Git-Tag: testing/wip-vshankar-testing-20250825.134853-debug~11^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=adb9b0718a2d4b14baaea413f319c76c1675d0e8;p=ceph-ci.git crimson/osd/scrub: check if stats have been marked invalid In case of splits/merges the PeeringState::split_into function will mark the child and parent pgs stats invalid. We need to check for this when scrub finishes, update the stats and mark them valid. Fixes: https://tracker.ceph.com/issues/72676 Signed-off-by: Aishwarya Mathuria --- diff --git a/src/crimson/osd/scrub/pg_scrubber.cc b/src/crimson/osd/scrub/pg_scrubber.cc index 0ad206ffe75..1ee27c1a73d 100644 --- a/src/crimson/osd/scrub/pg_scrubber.cc +++ b/src/crimson/osd/scrub/pg_scrubber.cc @@ -277,6 +277,12 @@ void PGScrubber::emit_scrub_result( DEBUGDPP("", pg); pg.peering_state.update_stats( [this, FNAME, deep, &in_stats](auto &history, auto &pg_stats) { + // Handle invalid stats, in case of split/merge + if (pg_stats.stats_invalid) { + pg_stats.stats.sum = in_stats; + pg_stats.stats_invalid = false; + DEBUGDPP(" repaired invalid stats! ", pg); + } foreach_scrub_maintained_stat( [deep, &pg_stats, &in_stats]( const auto &name, auto statptr, bool skip_for_shallow) {