-
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
BigQuery column ordering change causes destroy #8337
Comments
@daisy1754 can you please add the plan output here |
See https://github.com/hashicorp/terraform-provider-google/pull/8325/files where we've reverted the behaviour causing Terraform to attempt to destroy the table. This release should go out midday (PST) Monday. |
@rileykarson @venkykuberan can you reopen this? even after revert this would cause permadiff (at least it did with 3.25.0) |
@venkykuberan I don't have diff handy but it was essentially trying to delete created_at field from certain position and trying to add created_at to certain position |
Sorry, there's a whole network of bugs here and I probably should have done some context links. From my perspective the new part about this bug is the "ordering changes causes destroy" part based on a few other pieces of context below. It was true for a long time that the provider didn't take reorderings into consideration: #4143. I believe it's expected that That behaviour was resolved in GoogleCloudPlatform/magic-modules#3751 which was released in However while fixing another minor bug (#7979) a regression was introduced where ordering changes were no longer properly taken into account. That's captured in #8282. That regression was innocuous until the recreation behaviour introduced in Where we are now is:
tl;dr: The permadiff in earlier versions was captured in #4143 and the permadiff in Edit: I wrote up how we can roll out this change more safely in this comment by adding In the meantime for any users who see this before getting affected, I'd recommend applying lifecycle.prevent_destroy on the resource to prevent Terraform being able to delete it. |
thanks for clarification! |
Hello, Regards, |
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! |
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 v0.12.29
Affected Resource(s)
google_bigquery_table
Terraform Configuration Files
schema
Issue happens when we reorder (we autogenerate schame and something changed in auto generated schema) like below:
Debug Output
Panic Output
Expected Behavior
I should see no diff when bigquery column order changes in schema file
Actual Behavior
I saw diff in older version of terraform-provider-google (and I was just ignoring).
After I update plugin from 3.25.0 to 3.54.0, now terraform try to destroy the table, ie
Steps to Reproduce
terraform apply
with old schematerraform apply
with new schemaImportant Factoids
References
The text was updated successfully, but these errors were encountered: