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

SqlWaitForAG: Does not evaluate if the Availability Group was successfully created #1569

Closed
johlju opened this issue Jun 9, 2020 · 6 comments · Fixed by #1636
Closed

SqlWaitForAG: Does not evaluate if the Availability Group was successfully created #1569

johlju opened this issue Jun 9, 2020 · 6 comments · Fixed by #1636
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Member

johlju commented Jun 9, 2020

SqlWaitForAG resource evaluates if the Windows Failover Cluster role/group has been created. But the Windows Failover Cluster role/group is created before the Availability Group is in a ready state. When the Windows Failover Cluster role/group is found the resource will wait one more time according to the value of RetryIntervalSec before returning. There is currently no check to validate that the Availability Group was successfully created and is in a ready state.

@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Jun 9, 2020
@johlju johlju changed the title SqlWaitForAG: Does not evaluate the if the Availability Group was successfully created SqlWaitForAG: Does not evaluate if the Availability Group was successfully created Jul 5, 2020
@Fiander
Copy link
Contributor

Fiander commented Nov 2, 2020

hmm, wanting to pick this one up.
but I think this will be a breaking change. Eg I will need to introduce two extra parameters: $ServerName and $InstanceName.
will that be a problem?

@Fiander
Copy link
Contributor

Fiander commented Nov 4, 2020


the fix is done, only i've mesed up with the SqlRole. SqlRole has messed up my masterBase, and waitforAg now depends on this messed up base.

@johlju johlju added in progress The issue is being actively worked on by someone. breaking change When used on an issue, the issue has been determined to be a breaking change. and removed help wanted The issue is up for grabs for anyone in the community. breaking change When used on an issue, the issue has been determined to be a breaking change. labels Nov 23, 2020
johlju pushed a commit that referenced this issue Nov 25, 2020
… available (#1636)

- SqlWaitForAG
  - BREAKING CHANGE: Fix for issue (issue #1569)
    The resource now waits for the Availability Group to become Available.
  - Two parameters where added to test get and set resource at instance level.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Nov 25, 2020
@AndreasMWalter
Copy link

@Fiander @johlju
This is indeed a breaking change and also provides the following problem:
I use this resource to wait for the AG (that was created on the primary node), before adding the replica on the secondary. (I assume this is the intended purpose?)
However rather than looking on the primary for the AG it will look for the AG on the secondary which does not yet have it, since SqlAGReplica depends on this resource.
image
So unless I have missunderstood the resource this basically breaks every configuration.

@AndreasMWalter
Copy link

@Fiander @johlju
This is indeed a breaking change and also provides the following problem:
I use this resource to wait for the AG (that was created on the primary node), before adding the replica on the secondary. (I assume this is the intended purpose?)
However rather than looking on the primary for the AG it will look for the AG on the secondary which does not yet have it, since SqlAGReplica depends on this resource.
image
So unless I have missunderstood the resource this basically breaks every configuration.

So just that you know, I have fixed this with using WaitForAll Resource instead of SqlWaitForAG, still would be nice to know the intended purpose of this DSC Resource, since waits on the same node can be done with dependencies anyway.

@powertim
Copy link

Hi @AndreasMWalter , could you please show me some example configuration with WaitForAll instead of SqlWaitForAG ?
As I'm using Ansible to apply DSC config, I'm afraid I can't use this method.
Thanks for your help.

@AndreasMWalter
Copy link

Hiya @powertim, basically we are using

                WaitForAll PRIMARYAG
                {
                    ResourceName = "[SqlAg]PRIMARYAG"
                    NodeName = $Node.ClusterNodes | Where-Object -FilterScript {$_ -like 'PRIMARYNODENAME'} 
                    PsDscRunAsCredential = $Credential
                }

That resource connects to the primary and checks whether the SqlAg Resource is compliant before it lets the configuration continue.

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

Successfully merging a pull request may close this issue.

4 participants