Better error handling and verbosity - #16
Merged
Merged
Conversation
Fixes a bug where previous script could error and not process rest of commands. Now processes each process and account singly and indicates if already exists. Also more correctly supports Verbose and Confirm switches.
Member
|
Thanks @sqlslinger ! |
Author
|
Sure, Chrissy. Love how fast you respond to these pull requests. This is Vince On Wed, Apr 6, 2016 at 5:35 PM, Chrissy LeMaire notifications@github.com
|
potatoqualitee
pushed a commit
that referenced
this pull request
Jul 21, 2026
Invoke-DbaDbMirroring creates a "Mirroring" database-mirroring endpoint on BOTH instances to establish the session. Both suites tore down the mirrors and the databases but never the endpoints, so every run left them behind on the Multi pair. specs/lab-requirements.md requires those instances to be endpoint-free and LAB-12 enforces it, so preflight failed chronically - and a check that is always red is a check everyone learns to ignore, which is how the LAB-02 constants drift survived 14 days (#5). Measured: both sqldev and sqlcluster carried a leaked "Mirroring" endpoint with 0 mirrored databases in use. Dropped them; they came back on the next mirror run, which is what made this issue #16 rather than one-off cruft. Adds endpoint teardown as the third cleanup step, following the pattern Copy-DbaEndpoint.Tests.ps1:60-61 already uses. In Get-DbaDbMirrorMonitor it goes in the existing finally so it survives a throwing mirror teardown. Swept all three suites that call Invoke-DbaDbMirroring; Invoke-DbaDbMirroring's own suite already removed its endpoints (on the Copy pair). NOT yet verified end to end: #16 asks that LAB-12 be green AFTER the suites run. Get-DbaDbMirrorMonitor currently hard-kills the PowerShell process mid-suite (#19), so its AfterAll never executes and the endpoints still leak from that suite. The teardown here is correct but unreachable until #19 is fixed. (do Get-DbaDbMirror, Get-DbaDbMirrorMonitor) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Fixes a bug where previous script could error and not process rest of commands. Now processes each process and account singly and indicates if already exists. Also more correctly supports Verbose and Confirm switches.