Skip to content
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

DBaaS PosgresSQL requires apply twice to update datastore.connections #302

Open
legioner0 opened this issue Oct 9, 2024 · 1 comment
Open
Assignees

Comments

@legioner0
Copy link

I have selectel_dbaas_postgresql_datastore_v1 cluster with node_count==1, filled with data (~12Gb). For some reason I had to increase node_count to 2. After terraform apply, that took 11 minutes, I've found that datastore.connections contains only master node without replica. Only after second terraform apply, replica appeared in datastore.connections.

Terraform Version

Terraform v1.9.7

Terraform Provider Selectel Version

5.4.0

Affected Resource(s)

  • at least selectel_dbaas_postgresql_datastore_v1

Terraform Configuration Files

resource "selectel_dbaas_postgresql_datastore_v1" "datastore" {
    name        = "test1"
    node_count  = 1
    project_id  = "<sensitive value>"
    region      = "ru-2"
    subnet_id   = "<...>"
    type_id     = "b15e73d3-e585-4b6c-bc95-0b698de8f771" # PostgreSQL 14

    flavor {
        disk  = 32
        ram   = 4096
        vcpus = 1
       }

    pooler {
        mode = "transaction"
        size = 50
       }
   }

Expected Behavior

datastore.connections updated (add replica) on first terraform apply

Actual Behavior

datastore.connections not updated of first terraform apply

Steps to Reproduce

  1. terraform apply
  2. fill database with data
  3. increase node_count
  4. terraform apply - datastore.connections not updated
  5. terraform apply - datastore.connections updated correctly
@legioner0
Copy link
Author

Ok, this problem is not related to size of data in DB - datastore.connections not updated on plan stage.
So step to reproduce:

  1. terraform apply - datastore.connections not updated
  2. terraform apply - datastore.connections updated correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants