-
Notifications
You must be signed in to change notification settings - Fork 200
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
"tuple concurrently updated" error on concurrent GRANT statements #178
Comments
I think this is a similar problem to the issue/fix in #169 |
I'm having the same issue, even after upgrading to 1.15 and configuring parallelism=0 |
We were able to fix the issue by setting TF_CLI_ARGS_apply="-parallelism=1" (on provider version 1.15.0), but this certainly isn't ideal. I would love a fix as described above. |
same issue, using provider version 1.15.0 |
We are experiencing the same problem even after upgrading to v1.15.0. We loop through a list of 3 items, create a Postgres user for each, and grant connect rights to those users. It fails consistently in the grant section.
Terraform version 1.1.8 Update: |
bump. I have many resources in additional to postgres grants in the same workspace. I dont want to have to set |
This really needs to be fixed, -parallelism=1 makes Terraform runs take hours.... |
Would love to see this fixed. A retry approach for this specific error would be sweet! |
Using postgresql provider parameter |
The "fix" in #224 has broken the max_connections = 1 setting, so I'm having to pin to provider version 1.1.7 |
still have this issue in 1.18 |
Any chance the change in #224 can be rolled back? In the past we could set max_connections = 1 and it would work, now it's just totally broken for versions > 1.1.7 |
Hey everyone - I think I have a working fix in #352. |
As a workaround you can use |
* Using terratest just wasn't working out - it isn't designed for testing a provider * github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource looks like the right option but I don't have the time to learn it right now.
Hi everyone, I went ahead and released a beta version which targets the Using this beta release, the I'd appreciate it if anyone else could test and confirm these results as well.
|
Oops, didn't mean to close. |
One datapoint: our internal TF module, which creates a DB and executes several GRANTs did just run perfectly on the first try with the version "1.21.1-beta.1" 👍 Previously, the first run was almost guaranteed to trigger the "tuple concurrently updated" condition. We always needed at least 2 (sometimes 3) attempts to run to completion. Thanks a lot for fixing this! |
Really appreciate the work👍 |
this prevents errors like: could not execute revoke query: pq: tuple concurrently updated error see cyrilgdn/terraform-provider-postgresql#178
Hi. We still face this issue with 1.21.1-beta.1.
|
I'm also facing this issue in 1.22.0.
|
Maybe the owner can merge the branch "1.21.1-beta.1" to master? |
It seems to have fixed our previous issues as well, we've been using this |
Terraform Version
1.1.1
Affected Resource(s)
postgresql_grant
Terraform Configuration Files
Panic Output
Expected Behavior
Multiple
GRANT
statements should get executed correctly.Actual Behavior
terraform apply
fails intermittently when multipleGRANT
statements are involved.Steps to Reproduce
terraform apply
with multiple grant statements. You can also try a large number of statements with a for_each to make it more likely that the error will happen.Important Factoids
Found this threads on postgres/terraform mailing lists:
The "solution" seems to be to run things sequentially. However, ideally, we should be able to handle this at the provider level. For ex. by either locking the table appropriately, or by retrying after a backoff period perhaps before failing.
One interesting thing that happened was that with my
terraform apply
, when TF exited, it didn't save the state. So, it created some resources, but they weren't tracked in the state. That could be a Terraform bug, but I thought I should at least mention it here.The text was updated successfully, but these errors were encountered: