Fix WAL validation for multi-timeline recovery targets#4
Merged
Conversation
When validating a backup with --recovery-target-timeline different from the backup's timeline, pg_probackup incorrectly searched for WAL segments on the target timeline instead of the backup's timeline. Changes in C code: - validate_backup_wal_from_start_to_stop now always uses backup->tli for checking backup consistency (WAL from start_lsn to stop_lsn) - Added multi-timeline support in validate_wal: when target timeline differs from backup timeline, validation is performed in two phases: 1. From stop_lsn to switchpoint on backup's timeline 2. From switchpoint to target_lsn on target timeline - Pass target_tli to validate_wal in restore.c when specified Test fixes: - Remove @unittest.expectedFailure from test_validate_target_lsn - Add set_archiving for restored node to archive timeline 2 WAL - Fix switch_wal_segment call to use node_restored instead of node
5437b33 to
06108fd
Compare
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.
Summary
When validating a backup with
--recovery-target-timelinedifferent from the backup's timeline, pg_probackup incorrectly searched for WAL segments on the target timeline instead of the backup's timeline.Changes
C code:
validate_backup_wal_from_start_to_stopnow always usesbackup->tlifor checking backup consistencyvalidate_waltarget_tlitovalidate_walwhen specifiedTest:
@unittest.expectedFailurefromtest_validate_target_lsnTest plan
test_validate_target_lsnpasses