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

cannot update routing information in google_bigtable_app_profile #7314

Closed
n-oden opened this issue Sep 21, 2020 · 5 comments
Closed

cannot update routing information in google_bigtable_app_profile #7314

n-oden opened this issue Sep 21, 2020 · 5 comments
Assignees
Labels

Comments

@n-oden
Copy link

n-oden commented Sep 21, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.12.28
+ provider.google v3.39.0

Affected Resource(s)

  • google_bigtable_app_profile

Terraform Configuration Files

variable "project" {
  default = "my-test-project"
}

variable "region" {
  default = "us-east1"
}

provider "google" {
  region = var.region
}

resource "google_project_service" "bigtable" {
  project = var.project
  service = "bigtable.googleapis.com"

  disable_dependent_services = false
  disable_on_destroy         = false
}

resource "google_bigtable_instance" "test" {
  name       = "profile-test"
  project    = var.project
  depends_on = [google_project_service.bigtable]

  cluster {
    cluster_id   = "test-cluster-us-east1"
    zone         = "us-east1-c"
    num_nodes    = 1
    storage_type = "HDD"
  }

  cluster {
    cluster_id   = "test-cluster-us-central1"
    zone         = "us-central1-a"
    num_nodes    = 1
    storage_type = "HDD"
  }

  deletion_protection = false
  instance_type       = "PRODUCTION"
}

resource "google_bigtable_app_profile" "test" {
  instance       = google_bigtable_instance.test.name
  app_profile_id = "test-profile"
  project        = var.project
  description    = "test app profile"

  single_cluster_routing {
    cluster_id                 = "test-cluster-${var.region}"
    allow_transactional_writes = true
  }

}

Debug Output

https://gist.github.com/n-oden/8127f40c5e8fdba38e8cd30b1ad9c285

Expected Behavior

Terraform should perform an in-place edit of the bigtable_app_profile when a change to the target cluster_id happens.

Actual Behavior

Error: Error updating AppProfile "projects/my-test-project/instances/profile-test/appProfiles/test-profile": 
  googleapi: Error 400: A non-empty 'update_mask' must be specified

Steps to Reproduce

With the configuration above:

  1. terraform apply -var region=us-east1
  2. terraform apply -var region=us-central1
@ghost ghost added the bug label Sep 21, 2020
@venkykuberan venkykuberan self-assigned this Sep 21, 2020
@venkykuberan
Copy link
Contributor

@n-oden terraform/provider isn't deducting the change in single_cluster_routing block thus not including it in update masks list.. We will work on fixing it. However submitting your rerouting request gets you the following error

Error: Error updating AppProfile "projects/xxx/instances/profile-test/appProfiles/test-profile": googleapi: Error 400: Rerouting this app profile to test-cluster-us-central1 will cause a temporary lapse in read-your-writes consistency until your writes to test-cluster-us-east1 finish replicating. : Since this app profile allows single-row transactions, rerouting it to test-cluster-us-central1 will create the potential for conflicting writes, as transactions may execute without seeing unreplicated data from test-cluster-us-east1.

@n-oden
Copy link
Author

n-oden commented Sep 22, 2020

Hi @venkykuberan and thanks for the quick review! Yes, sorry, I should have added ignore_warnings = true to the example HCL. (Our internal use case here is for handling regional outages / disaster recovery, so at the time this executes there should be no transactions in-flight.)

@c2thorn
Copy link
Collaborator

c2thorn commented Sep 29, 2020

I believe this was fixed in v3.40.0 with #7266. Closing for now, but feel free to respond if you have found otherwise.

@c2thorn c2thorn closed this as completed Sep 29, 2020
@n-oden
Copy link
Author

n-oden commented Oct 6, 2020

Confirmed fixed; thank you!

@ghost
Copy link

ghost commented Oct 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants