WT-18433 Report the block header fields on a read checksum mismatch - #14490
Draft
etienneptl wants to merge 1 commit into
Draft
WT-18433 Report the block header fields on a read checksum mismatch#14490etienneptl wants to merge 1 commit into
etienneptl wants to merge 1 commit into
Conversation
A block that fails its checksum is now logged with the fields decoded from the header it just read, and with an explicit verdict on whether the size the block declares for itself agrees with the size from the address cookie. That comparison separates two failure modes that were indistinguishable in the log: the expected block with damaged bytes, where bit flip analysis is the right next step, and a structurally valid block of a different size sitting at that offset, where it is meaningless and the remediation is completely different. Telling them apart previously required hand-decoding the raw dump, which is awkward because the dump can contain user data. On the block header checksum branch, where no scan of the block runs, also test whether the stored checksum differs from the expected one by exactly one bit. No scan can find that flip, because a scan assumes the stored checksum is the one the write path computed. Diagnostic output only: the read still fails and still panics.
|
Thanks for creating a pull request! Please answer the questions below by editing this comment — completing this upfront typically speeds up the review process. Checklist before requesting a review
What makes this change safe?Help reviewers focus their attention by answering these questions:
Type of change made in this PR
References: |
|
Woohoo, the code changed in this PR is pretty well tested! 🎉
|
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 a block read fails its checksum,
__wti_block_read_off()reported the two checksums and dumped the raw block, but never the fields already sitting in the header it had just read — in particular it never compared the header'sdisk_sizeagainst the size in the address cookie. That one comparison separates the right block with damaged bytes (bit rot; the existing flip scan is the right next step) from a structurally valid block of a different size at that offset (a stale, misdirected or lost read/write, where flip analysis is meaningless). Both previously printed the same line, so telling them apart took a manual hex decode of a dump that can contain user data.Adds a separate
__wt_errx_id(session, 1843300, ...)line carrying the decoded headers and a greppable verdict:On the block header checksum branch, where no scan runs today, the stored checksum is also tested for being one bit off the expected one — no scan can find that flip, because a scan assumes the stored checksum is the one the write path computed.
Diagnostic output only: the read still fails and still panics.