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

fix(Cloud-Databases): RR & PITR Groups Attribute is Fixed for Source Formations with Multiple Members #5871

Merged
merged 5 commits into from
Dec 13, 2024

Conversation

omaraibrahim
Copy link
Collaborator

@omaraibrahim omaraibrahim commented Dec 12, 2024

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

Description

Read Replicas and PITRs are not working for formations with multiple members.

This is because our codebase assumes that the source formation will always have the default members. In the fix, we will now get the members from the source formation.

Example of Successful Read Replica with 3 members

resource "ibm_database" "postgresql" {
  resource_group_id            = data.ibm_resource_group.test_acc.id
  name                         = "omar-psql-12-12-us-east-pg-rr"
  service                      = "databases-for-postgresql"
  plan                         = "standard"
  location                     = "us-east"
  service_endpoints            = "public"
  version = "15"
  remote_leader_id = "crn:v1:bluemix:public:databases-for-postgresql:us-east:a/40ddc34a953a8c02f10987b59085b60e:d70adc01-434b-4482-a403-a43fa658dfce::"
  group {
    group_id = "member"
    cpu {
      allocation_count = 3
    }
    disk {
      allocation_mb = 30720
    }
    host_flavor {
      id = "multitenant"
    }
    memory {
      allocation_mb = 7168
    }
  }
}
Screenshot 2024-12-12 at 2 44 46 PM

Example of Successful Read Replica with 2 members

resource "ibm_database" "postgresql" {
  resource_group_id            = data.ibm_resource_group.test_acc.id
  name                         = "omar-psql-12-12-us-east-pg-rr-2"
  service                      = "databases-for-postgresql"
  plan                         = "standard"
  location                     = "us-east"
  service_endpoints            = "public"
  version = "16"
  remote_leader_id = "crn:v1:bluemix:public:databases-for-postgresql:us-east:a/40ddc34a953a8c02f10987b59085b60e:490d8e84-18b4-43f1-80c5-cd206406672a::"
  group {
    group_id = "member"
    cpu {
      allocation_count = 3
    }
    disk {
      allocation_mb = 30720
    }
    host_flavor {
      id = "multitenant"
    }
    memory {
      allocation_mb = 7168
    }
  }
}
Screenshot 2024-12-12 at 3 16 57 PM

Example of Successful PITR with 3 members

resource "ibm_database" "postgresql" {
  resource_group_id            = data.ibm_resource_group.test_acc.id
  name                         = "omar-psql-12-10-us-east-pg-pitr"
  service                      = "databases-for-postgresql"
  plan                         = "standard"
  location                     = "us-east"
  service_endpoints            = "public"
  version = "15"
  point_in_time_recovery_deployment_id = "crn:v1:bluemix:public:databases-for-postgresql:us-east:a/40ddc34a953a8c02f10987b59085b60e:d70adc01-434b-4482-a403-a43fa658dfce::"
  point_in_time_recovery_time = "2024-12-09T21:24:02.000Z"
  group {
    group_id = "member"
    cpu {
      allocation_count = 3
    }
    disk {
      allocation_mb = 30720
    }
    host_flavor {
      id = "multitenant"
    }
    memory {
      allocation_mb = 7168
    }
  }
}
Screenshot 2024-12-12 at 3 53 02 PM

Example of Successful PITR with 2 members

resource "ibm_database" "postgresql" {
  resource_group_id            = data.ibm_resource_group.test_acc.id
  name                         = "omar-psql-12-12-us-east-pg-pitr-2"
  service                      = "databases-for-postgresql"
  plan                         = "standard"
  location                     = "us-east"
  service_endpoints            = "public"
  version = "16"
  point_in_time_recovery_deployment_id = "crn:v1:bluemix:public:databases-for-postgresql:us-east:a/40ddc34a953a8c02f10987b59085b60e:490d8e84-18b4-43f1-80c5-cd206406672a::"
  point_in_time_recovery_time = "2024-12-12T14:46:07.000Z"
  group {
    group_id = "member"
    cpu {
      allocation_count = 2
    }
    disk {
      allocation_mb = 30720
    }
    host_flavor {
      id = "multitenant"
    }
    memory {
      allocation_mb = 7168
    }
  }
}
Screenshot 2024-12-12 at 4 13 49 PM

Acceptance Tests

make testacc TEST=./ibm/service/database TESTARGS='-run=TestAccIBMDatabaseInstance_Redis_Basic'
...
--- PASS: TestAccIBMDatabaseInstance_Redis_Basic (1409.12s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database	1410.850s
make testacc TEST=./ibm/service/database TESTARGS='-run=TestAccIBMDatabaseInstanceMongodbBasic'
...
--- PASS: TestAccIBMDatabaseInstanceMongodbBasic (1083.59s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database	1084.952s
make testacc TEST=./ibm/service/database TESTARGS='-run=TestAccIBMDatabaseInstance_ElasticsearchPlatinum_Basic'
...
--- PASS: TestAccIBMDatabaseInstance_ElasticsearchPlatinum_Basic (1742.79s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database	1744.144s

@omaraibrahim omaraibrahim marked this pull request as ready for review December 12, 2024 21:15
Copy link
Collaborator

@alexhemard alexhemard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@omaraibrahim omaraibrahim merged commit 305ad4b into IBM-Cloud:master Dec 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants