-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 Cloud SQL read replica instance with binary logging enabled #11424
Cannot update Cloud SQL read replica instance with binary logging enabled #11424
Comments
Hello, This bug/issue is still present, even though it was supposedly fixed in GoogleCloudPlatform/magic-modules#4907. We are using the latest provider and TF, and the issue is still present. Other people have also confirmed it, in e.g. #12148, but I cannot reopen nor comment on that thread to confirm it there as well. We would really like to see this fixed, instead of having to use workarounds, which often cause some issues, as we have to manually (via gcloud) temporarily disable binary logging on replicas in order to update the conf and then manually enable it back, having to set We are using MySQL 8.x, and the error still says:
Binary logging on read replicas can be enabled even when backups disabled - https://cloud.google.com/sql/docs/mysql/replication#bin-log-replica Some info on the issue and solution here: https://discuss.hashicorp.com/t/error-when-provision-read-replica-with-binary-log-enabled/42255
Please let me know if you need more information or any additional logs. |
hashicorp#7044) fix hashicorp/terraform-provider-google#11424 Signed-off-by: Modular Magician <[email protected]>
hashicorp#7044) fix hashicorp#11424 Signed-off-by: Modular Magician <[email protected]>
#7044) (#5057) fix hashicorp/terraform-provider-google#11424 Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
#7044) (#13406) fix #11424 Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
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. |
Community Note
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 tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v1.1.7
Affected Resource(s)
Terraform Configuration Files
Debug Output
when create new replica with binary logging (success)
https://gist.github.com/Climber22/09449433d0433104dfa7f8b74b04df42
when update replica (failed)
https://gist.github.com/Climber22/bc2abc80e52bb1bcb9e18f261180d6f7
Panic Output
Expected Behavior
When you run
terraform apply
, updating Cloud SQL (read replica instance with binary logging enabled) completes without error.Actual Behavior
When you add some diff and run
terraform apply
again, updating Cloud SQL was failed with error message below.Terraform tries to update read replica (mysql 5.7), so error message above looks wrong.
I wrote information about the reason for this confusing error message (
Reason of this issue
section)Steps to Reproduce
When you firstly run
terraform apply
, Cloud SQL instance will be successfully created without error.(Thanks for This PR, when create new one, PATCH method is explicitly called to enable binary_logging for replica instance )
Then, if you add some diff, and run
terraform apply
again, updating will be failed.Important Factoids
The problem
When try to update some params of read replica instance with binary logging enabled, terraform fails.
Reason of this issue
I ask this issue for GCP support, and they said that “This is because the difference between PATCH and PUT method”.
In detail, PATCH method will evaluate diff between current status and request body, and apply only diff.
On the other hand, PUT method will try to overwrite all parameter with request body.
ref: https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/patch?hl=ja
In this case, when terraform try to update Cloud SQL by PUT method, there is no information to show “this is replica instance”.
To add this information, terraform should add
instanceType
params and specify it as “READ_REPLICA_INSTANCE“ref: https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances?hl=ja#SqlInstanceType
(I tried to call PUT method with instanceType parameter manually, and it successfully completed.)
How to resolve this issue
In my opinion, adding
instanceType
field to google_sql_database_instance resource will solve this issue.Additionally, If google_sql_database_instance has
instanceType
field, creation of read replica with binary logging enabled can be done without PATCH method ( I’ve not tried it, just my hypothesis )References
The text was updated successfully, but these errors were encountered: