Skip to content

Update disk type schema field to support db-c4a-highmem-4 tier #13236

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

Merged
merged 11 commits into from
Apr 23, 2025

Conversation

shuang2018g
Copy link
Contributor

@shuang2018g shuang2018g commented Feb 28, 2025

New CloudSQL performance tier does not support PD_SSD, specifying PD_SSD as default disk type can cause creation failure unnecessarily. Update the field to computed without default allows CloudSQL to automatically choose the right disk type when not specified.

sql: the Terraform-based default value for `settings.disk_type` in `google_sql_database_instance` has been replaced with server-assigned default, allowing for compatibility with machine types that require `HyperDisk_Balanced`

@github-actions github-actions bot requested a review from NickElliot February 28, 2025 23:39
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@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 modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Feb 28, 2025
Copy link

github-actions bot commented Mar 5, 2025

@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

github-actions bot commented Mar 7, 2025

@GoogleCloudPlatform/terraform-team @NickElliot This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

clarifying the description, let me know if this wording isnt accurate!

Copy link

@shuang2018g, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days.

Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

@skysarthak
Copy link
Contributor

@NickElliot can we make the following edit on L1675 in mmv1/third_party/terraform/services/sql/resource_sql_database_instance_test.go:

-      enterprisePlusTier := "db-perf-optimized-C4A-4"
+      enterprisePlusTier := "db-c4a-highmem-4"

I created a PR to update this value but Shuang is OOTO. Reason for this request is that the public tier name for C4A was changed, you can refer the new name in the documentation here.

Copy link

@shuang2018g, this PR is waiting for action from you. If no action is taken, this PR will be closed in 14 days.

Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

@github-actions github-actions bot requested a review from NickElliot April 14, 2025 17:22
@shuang2018g shuang2018g changed the title Update disk type schema field to support db-perf-optimized-* tier Update disk type schema field to support db-c4a-highmem-4 tier Apr 14, 2025
@modular-magician modular-magician added service/sqladmin-cp and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Apr 14, 2025
@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.

google provider: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 4 files changed, 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field settings.disk_type default value changed from PD_SSD to <nil> on google_sql_database_instance - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 109
Passed tests: 5
Skipped tests: 21
Affected tests: 83

Click here to see the affected service packages
  • sql

Action taken

Found 83 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDataSourceGoogleSQLCaCerts_basic
  • TestAccDataSourceSqlDatabaseInstanceLatestRecoveryTime_basic
  • TestAccDataSourceSqlDatabaseInstance_basic
  • TestAccDataSourceSqlDatabaseInstances_basic
  • TestAccDataSourceSqlDatabaseInstances_databaseVersionFilter
  • TestAccDataSourceSqlDatabaseInstances_regionFilter
  • TestAccDataSourceSqlDatabaseInstances_tierFilter
  • TestAccDataSourceSqlDatabase_basic
  • TestAccDataSourceSqlDatabases_basic
  • TestAccSQLDatabaseInstance_DefaultEdition
  • TestAccSQLDatabaseInstance_DenyMaintenancePeriod
  • TestAccSQLDatabaseInstance_sqlMysqlDataCacheConfig
  • TestAccSQLDatabaseInstance_sqlPostgresDataCacheConfig
  • TestAccSQLDatabase_sqlDatabaseBasicExample
  • TestAccSQLDatabase_sqlDatabaseDeletionPolicyExample
  • TestAccSqlClientCert_mysql
  • TestAccSqlClientCert_postgres
  • TestAccSqlDatabaseInstance_BackupRetention
  • TestAccSqlDatabaseInstance_Edition
  • TestAccSqlDatabaseInstance_Edition_Downgrade
  • TestAccSqlDatabaseInstance_EnableGoogleDataplexIntegration
  • TestAccSqlDatabaseInstance_EnableGoogleMlIntegration
  • TestAccSqlDatabaseInstance_MysqlSwitchoverSuccess
  • TestAccSqlDatabaseInstance_Mysql_Edition_Upgrade
  • TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled
  • TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabledForSqlServer
  • TestAccSqlDatabaseInstance_PostgresSwitchoverSuccess
  • TestAccSqlDatabaseInstance_Postgres_Edition_Upgrade
  • TestAccSqlDatabaseInstance_RetainBackupOnDelete
  • TestAccSqlDatabaseInstance_Smt
  • TestAccSqlDatabaseInstance_SqlServerAuditOptionalBucket
  • TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate
  • TestAccSqlDatabaseInstance_SwitchoverSuccess
  • TestAccSqlDatabaseInstance_Timezone
  • TestAccSqlDatabaseInstance_activationPolicy
  • TestAccSqlDatabaseInstance_authNets
  • TestAccSqlDatabaseInstance_basicMSSQL
  • TestAccSqlDatabaseInstance_basicSecondGen
  • TestAccSqlDatabaseInstance_basic_with_user_labels
  • TestAccSqlDatabaseInstance_deleteDefaultUserBeforeSubsequentApiCalls
  • TestAccSqlDatabaseInstance_encryptionKey
  • TestAccSqlDatabaseInstance_encryptionKey_replicaInDifferentRegion
  • TestAccSqlDatabaseInstance_highAvailability
  • TestAccSqlDatabaseInstance_insights
  • TestAccSqlDatabaseInstance_maintenance
  • TestAccSqlDatabaseInstance_maintenanceVersion
  • TestAccSqlDatabaseInstance_maintenance_update_track_week5
  • TestAccSqlDatabaseInstance_multipleOperations
  • TestAccSqlDatabaseInstance_replica
  • TestAccSqlDatabaseInstance_rootPasswordShouldBeUpdatable
  • TestAccSqlDatabaseInstance_settingsDowngrade
  • TestAccSqlDatabaseInstance_settings_basic
  • TestAccSqlDatabaseInstance_settings_deletionProtection
  • TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled
  • TestAccSqlDatabaseInstance_settings_secondary
  • TestAccSqlDatabaseInstance_settings_upgrade
  • TestAccSqlDatabaseInstance_slave
  • TestAccSqlDatabaseInstance_sqlMysqlInstancePvpExample
  • TestAccSqlDatabaseInstance_updateDifferentFlagOrder
  • TestAccSqlDatabaseInstance_updateReadReplicaWithBinaryLogEnabled
  • TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL
  • TestAccSqlDatabaseInstance_useCasBasedServerCa
  • TestAccSqlDatabaseInstance_useCustomerManagedServerCa
  • TestAccSqlDatabaseInstance_useInternalCaByDefault
  • TestAccSqlDatabaseInstance_withPSCEnabled_thenAddAllowedConsumerProjects_thenRemoveAllowedConsumerProject
  • TestAccSqlDatabaseInstance_withPSCEnabled_thenAddPscAutoConnections_thenRemovePscAutoConnections
  • TestAccSqlDatabaseInstance_withPSCEnabled_withAllowedConsumerProjects
  • TestAccSqlDatabaseInstance_withPSCEnabled_withEmptyAllowedConsumerProjects
  • TestAccSqlDatabaseInstance_withPSCEnabled_withIpV4Enabled
  • TestAccSqlDatabaseInstance_withPSCEnabled_withPscAutoConnections
  • TestAccSqlDatabaseInstance_withPSCEnabled_withoutAllowedConsumerProjects
  • TestAccSqlDatabaseInstance_withPSCEnabled_withoutPscAutoConnections
  • TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange
  • TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeClone
  • TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeReplica
  • TestAccSqlDatabaseInstance_withPrivateNetwork_withoutAllocatedIpRange
  • TestAccSqlDatabase_basic
  • TestAccSqlDatabase_instanceWithActivationPolicy
  • TestAccSqlDatabase_update
  • TestAccSqlUser_password_wo
  • TestAccSqlUser_postgres
  • TestAccSqlUser_postgresAbandon
  • TestAccSqlUser_postgresIAM

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccDataSourceGoogleSQLCaCerts_basic [Debug log]
TestAccDataSourceSqlDatabaseInstanceLatestRecoveryTime_basic [Debug log]
TestAccDataSourceSqlDatabaseInstance_basic [Debug log]
TestAccDataSourceSqlDatabaseInstances_basic [Debug log]
TestAccDataSourceSqlDatabaseInstances_databaseVersionFilter [Debug log]
TestAccDataSourceSqlDatabaseInstances_regionFilter [Debug log]
TestAccDataSourceSqlDatabaseInstances_tierFilter [Debug log]
TestAccDataSourceSqlDatabase_basic [Debug log]
TestAccDataSourceSqlDatabases_basic [Debug log]
TestAccSQLDatabaseInstance_DefaultEdition [Debug log]
TestAccSQLDatabaseInstance_DenyMaintenancePeriod [Debug log]
TestAccSQLDatabaseInstance_sqlMysqlDataCacheConfig [Debug log]
TestAccSQLDatabaseInstance_sqlPostgresDataCacheConfig [Debug log]
TestAccSQLDatabase_sqlDatabaseBasicExample [Debug log]
TestAccSQLDatabase_sqlDatabaseDeletionPolicyExample [Debug log]
TestAccSqlClientCert_mysql [Debug log]
TestAccSqlClientCert_postgres [Debug log]
TestAccSqlDatabaseInstance_BackupRetention [Debug log]
TestAccSqlDatabaseInstance_Edition [Debug log]
TestAccSqlDatabaseInstance_Edition_Downgrade [Debug log]
TestAccSqlDatabaseInstance_EnableGoogleDataplexIntegration [Debug log]
TestAccSqlDatabaseInstance_EnableGoogleMlIntegration [Debug log]
TestAccSqlDatabaseInstance_MysqlSwitchoverSuccess [Debug log]
TestAccSqlDatabaseInstance_Mysql_Edition_Upgrade [Debug log]
TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabled [Debug log]
TestAccSqlDatabaseInstance_PointInTimeRecoveryEnabledForSqlServer [Debug log]
TestAccSqlDatabaseInstance_PostgresSwitchoverSuccess [Debug log]
TestAccSqlDatabaseInstance_Postgres_Edition_Upgrade [Debug log]
TestAccSqlDatabaseInstance_RetainBackupOnDelete [Debug log]
TestAccSqlDatabaseInstance_Smt [Debug log]
TestAccSqlDatabaseInstance_SqlServerAuditOptionalBucket [Debug log]
TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate [Debug log]
TestAccSqlDatabaseInstance_SwitchoverSuccess [Debug log]
TestAccSqlDatabaseInstance_Timezone [Debug log]
TestAccSqlDatabaseInstance_activationPolicy [Debug log]
TestAccSqlDatabaseInstance_authNets [Debug log]
TestAccSqlDatabaseInstance_basicMSSQL [Debug log]
TestAccSqlDatabaseInstance_basicSecondGen [Debug log]
TestAccSqlDatabaseInstance_basic_with_user_labels [Debug log]
TestAccSqlDatabaseInstance_deleteDefaultUserBeforeSubsequentApiCalls [Debug log]
TestAccSqlDatabaseInstance_encryptionKey [Debug log]
TestAccSqlDatabaseInstance_encryptionKey_replicaInDifferentRegion [Debug log]
TestAccSqlDatabaseInstance_highAvailability [Debug log]
TestAccSqlDatabaseInstance_insights [Debug log]
TestAccSqlDatabaseInstance_maintenance [Debug log]
TestAccSqlDatabaseInstance_maintenanceVersion [Debug log]
TestAccSqlDatabaseInstance_maintenance_update_track_week5 [Debug log]
TestAccSqlDatabaseInstance_multipleOperations [Debug log]
TestAccSqlDatabaseInstance_replica [Debug log]
TestAccSqlDatabaseInstance_rootPasswordShouldBeUpdatable [Debug log]
TestAccSqlDatabaseInstance_settingsDowngrade [Debug log]
TestAccSqlDatabaseInstance_settings_basic [Debug log]
TestAccSqlDatabaseInstance_settings_deletionProtection [Debug log]
TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled [Debug log]
TestAccSqlDatabaseInstance_settings_secondary [Debug log]
TestAccSqlDatabaseInstance_settings_upgrade [Debug log]
TestAccSqlDatabaseInstance_slave [Debug log]
TestAccSqlDatabaseInstance_sqlMysqlInstancePvpExample [Debug log]
TestAccSqlDatabaseInstance_updateDifferentFlagOrder [Debug log]
TestAccSqlDatabaseInstance_updateReadReplicaWithBinaryLogEnabled [Debug log]
TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL [Debug log]
TestAccSqlDatabaseInstance_useCasBasedServerCa [Debug log]
TestAccSqlDatabaseInstance_useCustomerManagedServerCa [Debug log]
TestAccSqlDatabaseInstance_useInternalCaByDefault [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_thenAddAllowedConsumerProjects_thenRemoveAllowedConsumerProject [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_thenAddPscAutoConnections_thenRemovePscAutoConnections [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withAllowedConsumerProjects [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withEmptyAllowedConsumerProjects [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withIpV4Enabled [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withPscAutoConnections [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withoutAllowedConsumerProjects [Debug log]
TestAccSqlDatabaseInstance_withPSCEnabled_withoutPscAutoConnections [Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange [Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeClone [Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRangeReplica [Debug log]
TestAccSqlDatabaseInstance_withPrivateNetwork_withoutAllocatedIpRange [Debug log]
TestAccSqlDatabase_basic [Debug log]
TestAccSqlDatabase_instanceWithActivationPolicy [Debug log]
TestAccSqlDatabase_update [Debug log]
TestAccSqlUser_password_wo [Debug log]
TestAccSqlUser_postgres [Debug log]
TestAccSqlUser_postgresAbandon [Debug log]
TestAccSqlUser_postgresIAM [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

A question about default behaviors on the resource:
while this wouldnt be a breaking change, is there scenarios where a resource made today with Terraform (that would've ended up with the present PD_SSD default) will end up with a different default disk_type upon creation of an identical configuration?

@shuang2018g
Copy link
Contributor Author

A question about default behaviors on the resource: while this wouldnt be a breaking change, is there scenarios where a resource made today with Terraform (that would've ended up with the present PD_SSD default) will end up with a different default disk_type upon creation of an identical configuration?

The existing configuration should continue to get PD_SSD as the default storage.

@github-actions github-actions bot requested a review from NickElliot April 15, 2025 22:07
@skysarthak
Copy link
Contributor

A question about default behaviors on the resource: while this wouldnt be a breaking change, is there scenarios where a resource made today with Terraform (that would've ended up with the present PD_SSD default) will end up with a different default disk_type upon creation of an identical configuration?

No, Hyperdisk will only be set as the default disk type for newly launched C4A (still in preview) machine series in CloudSQL. So customer would have to explicitly configure the resource to use C4A series public tier for the disk type to default to Hyperdisk.

Copy link

@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

please resolve the conflicts!

@shuang2018g shuang2018g reopened this Apr 22, 2025
@github-actions github-actions bot requested a review from NickElliot April 22, 2025 22:34
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Apr 22, 2025
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Apr 23, 2025
@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.

google provider: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 4 files changed, 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field settings.disk_type default value changed from PD_SSD to <nil> on google_sql_database_instance - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 111
Passed tests: 89
Skipped tests: 21
Affected tests: 1

Click here to see the affected service packages
  • sql

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
  • TestAccSqlDatabaseInstance_useCustomSubjectAlternateName

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccSqlDatabaseInstance_useCustomSubjectAlternateName [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@NickElliot NickElliot added the override-breaking-change Allows a potential breaking change to be merged label Apr 23, 2025
Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

LGTM, change is non breaking due to the default being replaced with computed. All current configs will produce the PD_SSD output by default still, change allows for compatibility with new machine types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
override-breaking-change Allows a potential breaking change to be merged service/sqladmin-cp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants