Closed giner closed 4 months ago
+1, impossible to apply changes, refresh is always stuck, as there are many objects, thus at least one fails. aws rds Postgresql 14.7. I see MR already on the way, but blocked state, please speed up blocking workflow tests.
Terraform v1.3.10 hashicorp/aws 4.67.0 for linux_amd64 cyrilgdn/postgresql 1.21.0 for linux_amd64
https://github.com/cyrilgdn/terraform-provider-postgresql/pull/351
from memory, there are issues using parallism and connection limits with some operations - the driver spins up a second connection to check the status of the actual request(s). As this second connection is blocked the driver is never able to determine the change is complete and it hangs. I run 2 provider configs, one allows multiple connections and the other doesn't - there are also issues with concurrent updates as well, hence the need to restrict the driver to 1 connection
This issue manifests itself regardless of max_connections and parallelism settings. This is mentioned in the description.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
terraform refresh
should not get stuckActual Behavior
terraform refresh
gets stuck atpostgresql_grant schema
in ~80% of runsSteps to Reproduce
--lock=false
is to avoid need in unlocking every time it gets stuck,--parallelism=1
is to eliminate possible side effects of parallelism)Important Factoids
postgresql_grant
is applied to (postgres
andpostgres
in this case, but this issue happens to any other database as long as both are the same), in this case connection to the database is reusedobject_type
isschema
Workarounds
Another one (with code modification) is to finish the previous transaction before starting a new one