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

Azure SQL FailoverGroup improvements #1361

Merged
merged 2 commits into from
Jan 20, 2021

Conversation

matthchr
Copy link
Member

Closes #1297

What this PR does / why we need it:

  • Fix bug preventing reconciliation of updates after a FailoverGroup was created.
  • Fix bug where status of long running operation was not properly monitored.
    This could cause intermittent errors of the form: "The Failover Group 'fg-test' is busy with another operation and cannot
    perform 'update Failover Group' operation. Please try again later."
  • Fix bug that caused an empty Status.Message field if the KeyVault was not accessible.
  • Unit tests should run in CI job

How does this PR make you feel:
gif

If applicable:

  • this PR contains documentation
  • this PR contains tests

./pkg/resourcemanager/keyvaults/unittest/ \
./pkg/resourcemanager/azuresql/azuresqlfailovergroup
# ./api/... \
Copy link
Member Author

Choose a reason for hiding this comment

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

Leave comment here explaining why these are commented out

Copy link
Member

Choose a reason for hiding this comment

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

Was the problem the missing line-continuation on the secrets line? I don't get why the api tests weren't running in that case though.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I just got to the azure pipeline change - there was nothing running it before, right.

@matthchr matthchr force-pushed the feature/azure-sql-failover-group branch 2 times, most recently from bd4b514 to ce6491b Compare January 19, 2021 18:18
babbageclunk
babbageclunk previously approved these changes Jan 20, 2021
Copy link
Member

@babbageclunk babbageclunk left a comment

Choose a reason for hiding this comment

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

This looks good. I think it would be worth using reflect.DeepEqual to compare the actual and expected if possible; If not there are some slight clarifications of the nil checks in various comparisons.

./pkg/resourcemanager/keyvaults/unittest/ \
./pkg/resourcemanager/azuresql/azuresqlfailovergroup
# ./api/... \
Copy link
Member

Choose a reason for hiding this comment

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

Was the problem the missing line-continuation on the secrets line? I don't get why the api tests weren't running in that case though.

@@ -24,6 +33,7 @@ type AzureSqlFailoverGroupSpec struct {
// +kubebuilder:validation:Required
Server string `json:"server"`
FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy"`
// TODO: This field should be a ptr as it must not be specified in the failover policy is Manual
Copy link
Member

Choose a reason for hiding this comment

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

It seems like treating zero as unspecified in this case would be ok, right? Although I guess it's potentially a valid value in the case that the policy is automatic.

Copy link
Member Author

Choose a reason for hiding this comment

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

No because in the case that the failover policy is automatic this field is required, and I believe 0 is a valid value. So you'd be unable to represent the 0 + automatic combination.

I just ignored it when the mode is manual (which is a smell IMO).

I've updated the TODO a bit more to clarify this though.

./pkg/resourcemanager/keyvaults/unittest/ \
./pkg/resourcemanager/azuresql/azuresqlfailovergroup
# ./api/... \
Copy link
Member

Choose a reason for hiding this comment

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

Oh, I just got to the azure pipeline change - there was nothing running it before, right.

pkg/resourcemanager/pollclient/pollclient.go Show resolved Hide resolved
 - Fix bug preventing reconciliation of updates after a FailoverGroup
   was created.
 - Fix bug where status of long running operation was not properly
   monitored.
@matthchr matthchr merged commit c446f1d into Azure:master Jan 20, 2021
@matthchr matthchr deleted the feature/azure-sql-failover-group branch January 20, 2021 21:22
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.

Bug: AzureSqlFailoverGroup needs improvements
2 participants