Repository navigation
Cleanup, output and -WhatIf - Fix the side findings of the progress work in 10 commands #10791
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
Merged
+1,717
−949
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4270d24
New-DbaAvailabilityGroup - Check the last progress record of each Id …
andreasjordan e2b5e3d
Sync-DbaAvailabilityGroup - Close the dedicated admin connection also…
andreasjordan 0b8ffb9
Invoke-DbaDbDataGenerator - Close the connection for the inserts also…
andreasjordan 52c952f
Invoke-DbaDbDataMasking - Clean up in finally blocks and stop writing…
andreasjordan f1c3ff9
Invoke-DbaAdvancedRestore - Stop the database after a failed restore …
andreasjordan 75d3ee4
Invoke-DbaAdvancedInstall - Return a result when the configuration fi…
andreasjordan 1460bca
Invoke-DbaDbLogShipRecovery - Stop writing a $null before the result …
andreasjordan f242ecf
Install-DbaInstance - Use the name given when the computer name canno…
andreasjordan e763c3a
New-DbaComputerCertificate - Remove the request folder in the finally…
andreasjordan 80f3b17
Install-DbaSqlPackage - Download nothing with -WhatIf
andreasjordan 9e99e49
Save-DbaKbUpdate - Report a failed download with Stop-Function
andreasjordan 2b00530
Invoke-DbaDbLogShipRecovery - Create the folder of the database below…
andreasjordan 136a2fc
New-DbaComputerCertificate - Test the removal of the request folder a…
andreasjordan f128350
New-DbaComputerCertificate - Guess the full name of a computer from i…
andreasjordan fffabc7
Invoke-DbaAdvancedRestore - Never restore with -VerifyOnly
andreasjordan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Keep all newly reached backups in VerifyOnly mode
Removing the return lets verification reach the last backup, but the dispatch above checks
($KeepCDC -or $ErrorBrokerConversations) -and -not $restore.NoRecoverybeforeVerifyOnly. For two full backups of the same database, the first has NoRecovery=true and is verified; the last has NoRecovery=false and enters the earlier branch, which calls ConnectionContext.ExecuteNonQuery with real RESTORE SQL.A concrete path is
Restore-DbaDatabaseover a directory containing multiple full backups with-VerifyOnly -KeepCDC(or Invoke-DbaAdvancedRestore with those backup records). Restore-DbaDatabase retains all records in verification mode and forwards these options. If the existing restore splat also includes-WithReplace, an idle existing target can be overwritten rather than merely verified.I independently executed the exact base/head dispatch branches using a recording boundary: base recorded only
VERIFY first-full.bak; head recorded that followed byEXECUTE RESTORE DATABASE [Probe] FROM DISK='last-full.bak' WITH RECOVERY, REPLACE, KEEP_CDC.Make VerifyOnly take precedence over every branch that can execute restore SQL while retaining verification of all files. Add a multi-backup regression with KeepCDC or ErrorBrokerConversations that checks every file is verified and no target database is created, restored, or recovered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, thanks. Fixed in fffabc7: the branch for
-KeepCDC/-ErrorBrokerConversationsand the page restore branch now require-not $VerifyOnly, so a verification never executes a restore statement. It was reachable before this PR as well: a single full backup is the last file and recovers, so-VerifyOnly -KeepCDCtook that branch for it.The new context "When -VerifyOnly with -KeepCDC verifies two full backups" builds the history the way Restore-DbaDatabase hands it over for
-VerifyOnly, without the selection, with a new database name and new file names, and checks that both files are verified and that no database exists afterwards.Lab, Windows PowerShell 5.1,
InstanceSingleSQL Server 2019:Invoke-DbaAdvancedRestore.Tests.ps1passes 21 of 21, andRestore-DbaDatabase.Tests.ps1, its caller, passes 86 with 3 skipped (the Azure contexts), as before. With theInvoke-DbaAdvancedRestore.ps1of f128350, the new context fails exactly as you describe: one "Verify successful" instead of two, and the restore of the second full backup created the database.This text was created by Claude and reviewed by Andreas Jordan.