-
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
Support google_sql_database_instance replica with settings.backup_configuration.binary_log_enabled=true #9371
Support google_sql_database_instance replica with settings.backup_configuration.binary_log_enabled=true #9371
Comments
@ivan-avguston can you share the debug log? |
@edwardmedia with pleasure
|
@ivan-avguston do you see if below config works for you? resource "google_sql_database_instance" "replica_database" {
database_version = "MYSQL_8_0"
master_instance_name = "master instance name"
settings {
backup_configuration {
binary_log_enabled = true
enabled = true
}
}
} |
No, it does not work for me.
This is expected behavior as described in the Google API documentation. As I aforementioned
As I said, the problem is in the request. Only one possibility for a replica to enable binary logs is sent a PATCH* for the existing instance with |
@ivan-avguston using the example , how did you reach to that error? Can you specify the detailed steps? |
Does that example work for you guys? Did you check and it works? You can create mysql replica database with enabled binlogs and you're astonished why it does not work for me, can't you? I meticulously replayed your example and it does not work for me
The same example with
|
@ivan-avguston I see what you mean now. Below call needs to be added in the provider in order to handle this feature. It can't be set in the initial
|
This appears to be an |
I was able to reproduce and have implemented the fix. It's unfortunate that the api is not smart enough to figure out the instance type prior to creation. The fix should be live in |
thank you a lot it's a really good piece of news. "Not smart enough" - I'd like to say it's awkward and silly to send twice a request to get a working instance. Google squad is aware of this topic and perhaps they give a positive answer |
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. |
Expected
Create a replica with enabled binary log
Terraform Version
Terraform v1.0.0
Affected Resource(s)
Steps to Reproduce
References
#7922
#6121
The reference issues were opened for more than a year and are you guys going to fix them?
The issue is I can't create a replica instance with
binary_log_enabled=true
it raises an exceptionError: Error, failed to update instance settings for : googleapi: Error 400: Invalid request: Binary log must be disabled when backup is disabled or the instance must be a replica instance with a MySQL 5.7 or above version., invalid
But backups
backup_configuration.enabled
can't be enabled on a replica by google API restriction, as far google API allows enabling binary logsbinary_log_enabled=true
My suggestion this happens because through the API you create by POST for a replica instance
PATCH request is not sent to update the replica instance with "binaryLogEnabled": true
The text was updated successfully, but these errors were encountered: