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

AvailabilityGroup backup history added #6251

Merged
merged 7 commits into from Jan 3, 2020
Merged

AvailabilityGroup backup history added #6251

merged 7 commits into from Jan 3, 2020

Conversation

@Stuart-Moore
Copy link
Contributor

Stuart-Moore commented Dec 17, 2019

Type of Change

  • Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (effects multiple commands or functionality, fixes # )
  • 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/sqlcollaborative/appveyor-lab ?
  • Nunit test is included
  • Documentation
  • Build system

Purpose

Have Get-DbaDbBackupHistory play nice with AG backup history spread across nodes

Approach

Little bit of recursion

Added another property to the BackupHistory object: AvailabilityGroupName
Select-DbaBackupInformation will now default to using AvailabilityGroupName if it's populated

If the SqlInstance is an AG listener then fire off a gddbh query to each node. For last,
pipe the results through Select-DbaBackupInformation to filter down to the full chain

If an instance is specified and the requested dbs are in an AG, then it will query all nodes in the AG for that database, but only use the instance for the other dbs.

Removed ParameterSet as it doesn't appear to do anything anymore.

Commands to test

Screenshots

Learning

@potatoqualitee

This comment has been minimized.

Copy link
Member

potatoqualitee commented Dec 17, 2019

ohhh @wsmelton - i think you've been wanting this for a while!

@Stuart-Moore

This comment has been minimized.

Copy link
Contributor Author

Stuart-Moore commented Dec 17, 2019

Be good to get @wsmelton to give it a thorough test. I'm sure he's got some more 'interesting' AG configurations than I've got to hand. Logic says it'll be fine, but reality's a harsh master

@Stuart-Moore

This comment has been minimized.

Copy link
Contributor Author

Stuart-Moore commented Dec 19, 2019

Failure appears to be nthing to do with this. Everyone happy if I merge?

@wsmelton

This comment has been minimized.

Copy link
Member

wsmelton commented Dec 19, 2019

Ok. So you might be able to answer this scenario without me having to dig through code...or see what was changed.

I have 3 node AG setup, the 3rd async replica is located at a DR site and is a named instance, but also because of security requires a custom port (not using 1433). I know in SMO that SQL Server class for AvailabilityGroup knows nothing of this port and only has the server name. When I pass in the listener in order to pull that backup history how is your code going to connect to that 3rd instance?

Now mind you I completely understand if it will break because we have the same issue in the DSC module for SQL Server and AG builds. If you can lay out how it connects to the other replicas to pull backup history I'm good with merging....

@potatoqualitee

This comment has been minimized.

Copy link
Member

potatoqualitee commented Jan 1, 2020

can we merge? 🐶 👀

@wsmelton

This comment has been minimized.

Copy link
Member

wsmelton commented Jan 2, 2020

It is fine with me to merge, just as long as folks understand it will have bugs that we cannot fix/resolve due to limitations in SMO....which I think should be rare cases.

@potatoqualitee

This comment has been minimized.

Copy link
Member

potatoqualitee commented Jan 3, 2020

Thank you 💯

@potatoqualitee potatoqualitee merged commit b64035a into development Jan 3, 2020
7 of 8 checks passed
7 of 8 checks passed
Module imports on all platforms (ubuntu-latest)
Details
Module imports on all platforms (ubuntu-latest)
Details
Module imports on all platforms (windows-latest)
Details
Module imports on all platforms (windows-latest)
Details
Module imports on all platforms (macOS-latest)
Details
Module imports on all platforms (macOS-latest)
Details
continuous-integration/appveyor/branch AppVeyor build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@potatoqualitee potatoqualitee deleted the aghistory branch Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.