]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/scrub: check if stats have been marked invalid
authorAishwarya Mathuria <amathuri@redhat.com>
Fri, 1 Aug 2025 10:11:02 +0000 (10:11 +0000)
committerAishwarya Mathuria <amathuri@redhat.com>
Thu, 21 Aug 2025 13:58:27 +0000 (13:58 +0000)
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 <amathuri@redhat.com>
src/crimson/osd/scrub/pg_scrubber.cc

index 0ad206ffe756e1d2a0d6cce8b81206033bb05801..1ee27c1a73d46d26278a4f1ebedae76dddfbcf9f 100644 (file)
@@ -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) {