Adding --check option to check WAL coherence #28
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.
Some days ago, a client of mine asked me if some tools were existing to check produced WAL sanity (in particular, let's say they have some trouble with their FS).
AFAIK, no tool is taking care of this (despite PostgreSQL itself when restoring, but it's not an option and a bit overkill anyway). I thought "xlogdump" would be the best tool to add this feature and start working on HEAD.
The patch is moving all existing error messages to stderr. When "--check" is givent, it stop reading the WAL as soon as an error is found.
As it's the first time I'm working on WAL related code, I'm not 100% clear about all the parts of this patch, neither when raising an error or not, especially about the continuous pages.
Here is my commit comment:
Force "xlogdump" to stop and returns 1 on the first incoherent found the
WAL file. Using "--check", "xlogdump" will not dump anything from the
file, it just performs a sanity check. Conflict with all other options.
This options aims to check for corruption on wal file archived (or not).
Thank you for your next review and comment !