-
Notifications
You must be signed in to change notification settings - Fork 225
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
SqlAgReplica: Failure to change AvailabilityMode and FailoverMode #1817
Comments
Sounds like this is what should be done, and if there is a setting that cannot be set in a group with others then that should be an exempt. 🤔 |
I agree. I just don't know if there was a historical or technical reason why it was implemented this way. |
@ShawnHardwick - are you working on a fix for this? If not, @johlju could you assign this to me so I could take care of it? |
I am not working on this. |
@hollanjs I assigned you. Please not that the unit tests are not run in the pipeline since they have not been converted to Pester 5. Since you want to work on this I will convert the tests so this change can be tested. The unit tests will be extensively changed, so wait to modify any tests for this change until the fix for issue #1753 is merged. 🙂 Converting the tests are gonna take me a few days since it a big test file. |
@hollanjs the unit test is now converted and merged. 🙂 |
@hollanjs I have not seen and PR for this for over a month. I will remove the assignment within a week unless I see a PR, so someone else can work on this. |
@johlju - my apologies! The Holiday's and life events got in the way and I didn't write to update this thread on that. I've made the changes and added some tests and plan to do a PR this week to resolve this. I am running into an issue though, one which I'm hoping you might be able to help with. I setup the Azure Pipeline, like you wrote in the community testing guidelines, however, it keeps erroring out on the
Link to my Azure Pipeline I can attempt to just do the PR to the main SqlServerDsc Azure Pipeline, and see if it also errors there, but I would like to get my Azure Pipeline squared away for future dev work. |
Ah we haven't update the community guidelines! I will fix that as soon as possible (sending myself a reminder). If you edit the pipeline, press the three dots to the right and choose Triggers The click Yaml The click on Get Sources and you find that "Shallow fetch" is checked: Uncheck "Shallow fetch". Should look like above. Make sure to click on Save & Queue (drop down list has just Save), so the pipeline is saved with the change. This was a recent change in Azure DevOps that they started to enforce this by default (prior default was not checked) And, yes, I could see your pipeline build 🙂 |
@johlju - worked like a charm! You should see a PR shortly. |
I have not tested the PR, but thanks for the great work. I look forward to seeing this in the next release. |
@ShawnHardwick If you can test the preview version that was released on merge, that have the change in in, that would be awesome. If there is still an issue, reopen the issue. 🙂 |
Problem description
For an AG replica where configured with
AvailabilityMode
toSynchronousCommit
andFailoverMode
set toAutomatic
, if the SqlAgReplica resource is requested to change theAvailabilityMode
to 'AsynchronousCommit' andFailoverMode
toManual
, then the resource returnsAn internal error occurred.
Verbose logs
DSC configuration
Suggested solution
AvailabilityMode
cannot be set toAsynchronousCommit
whenFailoverMode
set toAutomatic
. TheSqlAgReplica
resource currently updates each property in alphabetical order with individualalter()
commends (it seems). This means that it attempts to alter theAvailabilityMode
before modifying theFailoverMode
.The suggestion solutions might be:
alter()
command. Instead perform the change as one giantalter()
command.AvailabilityMode
andFailoverMode
properties into onealter()
FailoverMode
conditional before theAvailabityMode
conditional assuming there aren't other implications for this for other values.SQL Server edition and version
SQL Server PowerShell modules
Operating system
PowerShell version
SqlServerDsc version
The text was updated successfully, but these errors were encountered: