Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test-DBALsnChain - Fix missing log backup (#7515) #9467

Merged
merged 5 commits into from
Oct 5, 2024

Conversation

AdamJKoehler
Copy link
Contributor

Type of Change

  • [ x] Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • [x ] Ran manual Pester test and has passed (.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

Purpose

Fixing issue with Test-DBALsnChain that skips over a log backup that is written during a full backup that is being processed, but has not written a CheckpointLSN that can be used for the DatabaseBackupLSN record on the log backup.

Approach

Adding an additional check to see if the FirstLSN of the transaction log backup is greater than the CheckpointLSN of the full backup (instead of the log backup DatabaseBackupLSN being equal to the FULL backup's CheckpointLSN). This allows for the first log backup after the FULL backup to not be skipped for evaluation in the backup chain for restore purposes.
Manual Pester Results:
test-dbalsnchain_test_results

LSN data from backup files affected, and the error message received:
Backup_lsn_data

@potatoqualitee
Copy link
Member

hey @AdamJKoehler thank you for the PR! I'll take a look soon.

 gci -recurse test*lsn* | Invoke-DbatoolsFormatter
Copy link
Contributor Author

@AdamJKoehler AdamJKoehler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@potatoqualitee I see the command you used was different than what I did. That makes sense as to how to use it. Thanks!

@potatoqualitee potatoqualitee merged commit bf8423c into dataplat:development Oct 5, 2024
3 checks passed
@potatoqualitee
Copy link
Member

Thank you very much for your PR and your patience, Adam! Your fix will be in the upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants