Repository navigation
osd/scrub: auto-correct accounting-only stat mismatches - #68684
Merged
Merged
Conversation
When scrub detects a PG stats mismatch but no object-level inconsistencies (all replicas agree on actual data), fix the stats in place rather than reporting a scrub error. Previously, a pure stat mismatch would log [ERR], increment shallow_errors, and trigger OSD_SCRUB_ERRORS / PG_STATE_INCONSISTENT health alerts — yet leave the stats unfixed unless a repair scrub was manually initiated. The scrubber's own object count is authoritative in this case. Persistence of the corrected stats is deferred until the next transaction that sets dirty_info, consistent with the existing stats_invalid repair path. Signed-off-by: Ronen Friedman <[email protected]>
Contributor
Author
|
jenkins test make check |
rzarzynski
approved these changes
May 21, 2026
| m_scrub_cstat.sum.num_whiteouts != info.stats.stats.sum.num_whiteouts || | ||
| m_scrub_cstat.sum.num_bytes != info.stats.stats.sum.num_bytes) { | ||
|
|
||
| m_osds->clog->error() << info.pgid << " " << m_mode_desc |
Contributor
There was a problem hiding this comment.
For the sake of a bug investigation having an explicit log about ignoring the mismatch could be helpful.
Contributor
Author
There was a problem hiding this comment.
@rzarzynski:
There already is in this version a dout(1) for the else case. Did you mean something else?
Contributor
|
@ronen-fr: feel free to tag as |
Contributor
Author
|
marked 'needs-qa' - but (due to the date pressure) I'll also run my own Teuthology tests. |
Contributor
Author
|
Merging based on my Teuthology tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When scrub detects a PG stats mismatch but no object-level
inconsistencies (all replicas agree on actual data), fix the
stats in place rather than reporting a scrub error.
Previously, a pure stat mismatch would log [ERR], increment
shallow_errors, and trigger OSD_SCRUB_ERRORS / PG_STATE_INCONSISTENT
health alerts — yet leave the stats unfixed unless a repair
scrub was manually initiated. The scrubber's own object count
is authoritative in this case.
Persistence of the corrected stats is deferred until the next
transaction that sets dirty_info, consistent with the existing
stats_invalid repair path.
Added post-merge:
Fixes: https://tracker.ceph.com/issues/76562