Closed ShawnHardwick closed 1 year ago
Instead perform the change as one giant alter() command.
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. 🤔
Instead perform the change as one giant alter() command.
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?
@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.
@johlju - will hold till then. I'll keep an eye out for a notification on #1753 or word from you.
@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 Build
> Calculate ModuleVersion
:
You can invoke the tool using the following command: dotnet-gitversion
Tool 'gitversion.tool' (version '5.12.0') was successfully installed.
ConvertFrom-Json : Conversion from JSON failed with error: Error parsing Infinity value. Path '', line 1, position 1.
At D:\a\_temp\0de7a11f-e31b-4efb-9936-af91ddf14537.ps1:5 char:41
+ $gitVersionObject = dotnet-gitversion | ConvertFrom-Json
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
##[error]PowerShell exited with code '1'.
Link to my Azure Pipeline Not sure if the above link will be visible to you.
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