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

Alloydb CRR Promote Secondary Cluster #9271

Merged

Conversation

199201shubhamsahu
Copy link
Member

@199201shubhamsahu 199201shubhamsahu commented Oct 16, 2023

To Promote a Secondary Cluster, perform the following 2 changes in the secondary cluster config.

  1. Modify cluster_type = "PRIMARY"
  2. Remove the entire secondary_config field from the config 

Before

resource "google_alloydb_cluster" "secondary" {
  <required-fields> = <value>
  <other-fields> = <value>

  cluster_type = "SECONDARY"
  secondary_config {
    primary_cluster_name = google_alloydb_cluster.primary.name
  }
}

After

resource "google_alloydb_cluster" "secondary" {
  <required-fields> = <value>
  <other-fields> = <value>

  cluster_type = "PRIMARY"
}

After promotion the secondary cluster becomes an independent primary cluster.

Release Note Template for Downstream PRs (will be copied)

alloydb: added support for promotion for `SECONDARY` `google_alloydb_cluster` resources

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@NickElliot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 7 files changed, 2315 insertions(+), 12 deletions(-))
Terraform Beta: Diff ( 7 files changed, 2315 insertions(+), 12 deletions(-))
TF OiCS: Diff ( 4 files changed, 173 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3157
Passed tests 2814
Skipped tests: 318
Affected tests: 25

Action taken

Found 25 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_secondaryClusterPromoteWithNetworkConfigAndAllocatedIPRange|TestAccAlloydbInstance_secondaryInstanceUpdateQueryInsightConfig|TestAccAlloydbInstance_secondaryInstanceUpdateDatabaseFlag|TestAccAlloydbCluster_secondaryInstanceWithNetworkConfigAndAllocatedIPRange|TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate|TestAccAlloydbInstance_secondaryInstanceWithReadPoolInstance|TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig|TestAccAlloydbInstance_alloydbSecondaryInstanceBasicExample|TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbInstance_secondaryInstanceMaximumFields|TestAccAlloydbInstance_secondaryInstanceUpdateMachineConfig|TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary|TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate|TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy|TestAccAlloydbCluster_secondaryClusterPromote|TestAccAlloydbCluster_deleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_continuousBackup_update|TestAccAlloydbCluster_continuousBackup_CMEKIsUpdatable|TestAccAlloydbCluster_CMEKInAutomatedBackupIsUpdatable|TestAccAlloydbCluster_secondaryClusterUpdate|TestAccAlloydbCluster_secondaryClusterAddAutomatedBackupPolicy|TestAccAlloydbCluster_AutomatedBackupPolicyHandlesMidnight|TestAccAlloydbCluster_addAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_update|TestAccAlloydbCluster_restore

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccAlloydbCluster_deleteAutomatedBackupPolicyAndInitialUser[Debug log]
TestAccAlloydbCluster_continuousBackup_update[Debug log]
TestAccAlloydbCluster_continuousBackup_CMEKIsUpdatable[Debug log]
TestAccAlloydbCluster_CMEKInAutomatedBackupIsUpdatable[Debug log]
TestAccAlloydbCluster_AutomatedBackupPolicyHandlesMidnight[Debug log]
TestAccAlloydbCluster_addAutomatedBackupPolicyAndInitialUser[Debug log]
TestAccAlloydbCluster_update[Debug log]
TestAccAlloydbCluster_restore[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterPromoteWithNetworkConfigAndAllocatedIPRange[Error message] [Debug log]
TestAccAlloydbInstance_secondaryInstanceUpdateQueryInsightConfig[Error message] [Debug log]
TestAccAlloydbInstance_secondaryInstanceUpdateDatabaseFlag[Error message] [Debug log]
TestAccAlloydbCluster_secondaryInstanceWithNetworkConfigAndAllocatedIPRange[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate[Error message] [Debug log]
TestAccAlloydbInstance_secondaryInstanceWithReadPoolInstance[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig[Error message] [Debug log]
TestAccAlloydbInstance_alloydbSecondaryInstanceBasicExample[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser[Error message] [Debug log]
TestAccAlloydbInstance_secondaryInstanceMaximumFields[Error message] [Debug log]
TestAccAlloydbInstance_secondaryInstanceUpdateMachineConfig[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromote[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterUpdate[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterAddAutomatedBackupPolicy[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@NickElliot
Copy link
Contributor

Review is pending resolution of the tenant project error issues as all of the new tests related to this pr are not being successfully ran, sorry for any delays

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 8 files changed, 2152 insertions(+), 17 deletions(-))
Terraform Beta: Diff ( 7 files changed, 2152 insertions(+), 12 deletions(-))
TF OiCS: Diff ( 4 files changed, 151 insertions(+))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 7 files changed, 1964 insertions(+), 12 deletions(-))
Terraform Beta: Diff ( 7 files changed, 1964 insertions(+), 12 deletions(-))
TF OiCS: Diff ( 4 files changed, 151 insertions(+))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 7 files changed, 1964 insertions(+), 12 deletions(-))
Terraform Beta: Diff ( 7 files changed, 1964 insertions(+), 12 deletions(-))
TF OiCS: Diff ( 4 files changed, 151 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3187
Passed tests 2847
Skipped tests: 319
Affected tests: 21

Action taken

Found 21 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary|TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate|TestAccAlloydbCluster_secondaryInstanceWithNetworkConfigAndAllocatedIPRange|TestAccAlloydbInstance_secondaryInstanceMaximumFields|TestAccAlloydbInstance_secondaryInstanceWithReadPoolInstance|TestAccAlloydbInstance_secondaryInstanceUpdateMachineConfig|TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig|TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy|TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_secondaryClusterPromoteWithNetworkConfigAndAllocatedIPRange|TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate|TestAccAlloydbInstance_secondaryInstanceUpdateQueryInsightConfig|TestAccAlloydbInstance_secondaryInstanceUpdateDatabaseFlag|TestAccAlloydbInstance_alloydbSecondaryInstanceBasicTestExample|TestAccAlloydbCluster_secondaryClusterPromote|TestAccAlloydbCluster_secondaryClusterUpdate|TestAccAlloydbCluster_secondaryClusterAddAutomatedBackupPolicy|TestAccBigQueryDataTable_bigtable|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3192
Passed tests 2860
Skipped tests: 325
Affected tests: 7

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate|TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy|TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig|TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary|TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate|TestAccAlloydbCluster_secondaryClusterPromote

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3192
Passed tests 2859
Skipped tests: 325
Affected tests: 8

Action taken

Found 8 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy|TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig|TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate|TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary|TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate|TestAccAlloydbCluster_secondaryClusterPromote|TestAccDataprocJobIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig[Debug log]
TestAccAlloydbCluster_secondaryClusterPromote[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig[Debug log]
TestAccAlloydbCluster_secondaryClusterPromote[Debug log]
TestAccDataprocJobIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 1120 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 3 files changed, 1120 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3192
Passed tests 2862
Skipped tests: 325
Affected tests: 5

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy|TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate|TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser|TestAccDataSourceGoogleServiceAccountAccessToken_basic|TestAccDataSourceGoogleServiceAccountJwt

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy[Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate[Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser[Debug log]
TestAccDataSourceGoogleServiceAccountAccessToken_basic[Debug log]
TestAccDataSourceGoogleServiceAccountJwt[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccDataSourceGoogleServiceAccountJwt[Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 1128 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 3 files changed, 1128 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3192
Passed tests 2851
Skipped tests: 325
Affected tests: 16

Action taken

Found 16 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_deleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_update|TestAccAlloydbCluster_addAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_AutomatedBackupPolicyHandlesMidnight|TestAccAlloydbCluster_continuousBackup_update|TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary|TestAccAlloydbCluster_secondaryClusterPromoteWithNetworkConfigAndAllocatedIPRange|TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate|TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate|TestAccAlloydbCluster_secondaryClusterPromote|TestAccAlloydbCluster_CMEKInAutomatedBackupIsUpdatable|TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy|TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig|TestAccAlloydbCluster_continuousBackup_CMEKIsUpdatable|TestAccAlloydbCluster_restore

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccAlloydbCluster_deleteAutomatedBackupPolicyAndInitialUser[Error message] [Debug log]
TestAccAlloydbCluster_update[Error message] [Debug log]
TestAccAlloydbCluster_addAutomatedBackupPolicyAndInitialUser[Error message] [Debug log]
TestAccAlloydbCluster_AutomatedBackupPolicyHandlesMidnight[Error message] [Debug log]
TestAccAlloydbCluster_continuousBackup_update[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteWithNetworkConfigAndAllocatedIPRange[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndUpdate[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromote[Error message] [Debug log]
TestAccAlloydbCluster_CMEKInAutomatedBackupIsUpdatable[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndAddAndDeleteAutomatedBackupPolicyAndInitialUser[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndDeleteTimeBasedRetentionPolicy[Error message] [Debug log]
TestAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig[Error message] [Debug log]
TestAccAlloydbCluster_continuousBackup_CMEKIsUpdatable[Error message] [Debug log]
TestAccAlloydbCluster_restore[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 1128 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 3 files changed, 1128 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3192
Passed tests 2866
Skipped tests: 325
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccSpannerDatabaseIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccSpannerDatabaseIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@rileykarson rileykarson merged commit e6651cc into GoogleCloudPlatform:main Oct 31, 2023
7 checks passed
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 28, 2023
jialei-chen pushed a commit to jialei-chen/magic-modules that referenced this pull request Nov 29, 2023
@199201shubhamsahu 199201shubhamsahu deleted the alloydb-crr-promote branch April 11, 2024 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants