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

SqlAGReplica: Run Update-AvailabilityGroupReplica Once for All AvailabilityReplica Changes #1840

Merged
merged 14 commits into from
Jan 24, 2023

Conversation

hollanjs
Copy link
Contributor

@hollanjs hollanjs commented Jan 23, 2023

Pull Request (PR) description

This PR alters how the SqlAGReplica changes properties of the AvailabilityReplica. Rather than triggering an update for each individual property that is out of state, Update-AvailabilityGroupReplica now triggers only once at the end, applying all property updates at once.

To specifically resolve issues with FailoverMode and AvailabilityMode updates:

  • FailoverMode checks were moved up before AvailabilityMode checks
  • An additional tests has been added specifically to ensure FailoverMode and AvailabilityMode are always updated at the same time. This should hopefully ensure future changes do not cause this issue to come back.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Merging #1840 (d59a357) into main (979800d) will increase coverage by 0%.
The diff coverage is 100%.

Impacted file tree graph

@@         Coverage Diff          @@
##           main   #1840   +/-   ##
====================================
  Coverage    91%     91%           
====================================
  Files        71      71           
  Lines      7310    7313    +3     
====================================
+ Hits       6661    6664    +3     
  Misses      649     649           
Flag Coverage Δ
unit 91% <100%> (+<1%) ⬆️
Impacted Files Coverage Δ
...SCResources/DSC_SqlAGReplica/DSC_SqlAGReplica.psm1 100% <100%> (ø)

@hollanjs hollanjs marked this pull request as ready for review January 23, 2023 23:46
@johlju johlju added the needs review The pull request needs a code review. label Jan 24, 2023
@johlju
Copy link
Member

johlju commented Jan 24, 2023

@hollanjs awesome work! Looks great at initial glance. Will review later today.

Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 5 of 5 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @hollanjs)

@johlju johlju added ready for merge The pull request was approved by the community and is ready to be merged by a maintainer. and removed needs review The pull request needs a code review. labels Jan 24, 2023
@johlju johlju enabled auto-merge (squash) January 24, 2023 14:07
@johlju johlju changed the title Fix issue #1817 - Run Update-AvailabilityGroupReplica Once for All AvailabilityReplica Changes SqlAGReplica: Run Update-AvailabilityGroupReplica Once for All AvailabilityReplica Changes Jan 24, 2023
@johlju johlju merged commit 86869cd into dsccommunity:main Jan 24, 2023
@hollanjs hollanjs deleted the fix-issue-1817 branch January 24, 2023 15:32
@johlju johlju removed the ready for merge The pull request was approved by the community and is ready to be merged by a maintainer. label Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SqlAgReplica: Failure to change AvailabilityMode and FailoverMode
2 participants