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

do not retry if sql api returns 409 for deleted instance name #2817

Merged

Conversation

megan07
Copy link
Contributor

@megan07 megan07 commented Dec 11, 2019

Fixes hashicorp/terraform-provider-google#5101

Release Note Template for Downstream PRs (will be copied)

sql: fixed bug where terraform would keep retrying to create new `google_sql_database_instance` with the name of a previously deleted instance

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 7f91485.

Pull request statuses

No diff detected in terraform-google-conversion.
No diff detected in Ansible.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#1500
depends: hashicorp/terraform-provider-google#5141
depends: modular-magician/inspec-gcp#277

@@ -33,6 +33,10 @@ func pubsubTopicProjectNotReady(err error) (bool, string) {

func isSqlOperationInProgressError(err error) (bool, string) {
if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 409 {
if strings.Contains(gerr.Body, "you cannot reuse the name of the deleted instance until one week from the deletion date.") {
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm, i don't like this, but I'm not sure if we have a better option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I could use a smaller portion of the message, in case it were to change, but I'm not sure where to cut it off. I wasn't sure what else to key off of, because it's only the message that differentiates it from other 409s

megan07 and others added 2 commits December 12, 2019 20:02
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
@modular-magician modular-magician merged commit f206d90 into GoogleCloudPlatform:master Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creating SQL instance with same name as previously deleted instance hangs
4 participants