Skip to content

Conversation

olmoods
Copy link
Contributor

@olmoods olmoods commented Oct 3, 2025

Add Support for new Read Pool Auto Scale Config

Furthermore, since auto scaling will involve node_count being automatically updated, adds support for how to handle this field when auto scaling is enabled. Depends on #15312

go/mrp-autoscale-tf

Release Note Template for Downstream PRs (will be copied)

sql: added `read_pool_auto_scale_config` support to `sql_database_instance` resource

@olmoods olmoods marked this pull request as draft October 3, 2025 18:48
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming I didn't do this part correctly.

Copy link

github-actions bot commented Oct 3, 2025

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

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@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.

@github-actions github-actions bot requested a review from NickElliot October 3, 2025 18:49
@olmoods olmoods mentioned this pull request Oct 3, 2025
@olmoods olmoods marked this pull request as ready for review October 4, 2025 00:01
@olmoods olmoods marked this pull request as draft October 4, 2025 00:09
@olmoods olmoods force-pushed the autoscale-new branch 2 times, most recently from 3dd8a2e to f5f9725 Compare October 4, 2025 00:27
@olmoods olmoods marked this pull request as ready for review October 4, 2025 00:37
Copy link

github-actions bot commented Oct 8, 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
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.

could you open a seperate PR with the dependency updates? link this PR in the description and say its blocking this

@olmoods
Copy link
Contributor Author

olmoods commented Oct 8, 2025

Yes I have linked #15312 in description

@github-actions github-actions bot requested a review from NickElliot October 8, 2025 21:04
@psung
Copy link
Contributor

psung commented Oct 9, 2025

#15312 has now been merged.

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.

need the go.mod/sum changes removed from this pr now!

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Oct 13, 2025
@olmoods
Copy link
Contributor Author

olmoods commented Oct 13, 2025

Done!

@github-actions github-actions bot requested a review from NickElliot October 13, 2025 16:22
@modular-magician modular-magician added service/sqladmin-cp and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Oct 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, 450 insertions(+), 14 deletions(-))
google-beta provider: Diff ( 2 files changed, 450 insertions(+), 14 deletions(-))

Breaking Change(s) Detected

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

  • Field clone.source_instance_deletion_time within resource google_sql_database_instance was either removed or renamed - 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.

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_sql_database_instance (203 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_sql_database_instance" "primary" {
  node_count = # value needed
  settings {
    read_pool_auto_scale_config {
      disable_scale_in           = # value needed
      enabled                    = # value needed
      max_node_count             = # value needed
      min_node_count             = # value needed
      scale_in_cooldown_seconds  = # value needed
      scale_out_cooldown_seconds = # value needed
      target_metrics {
        metric       = # value needed
        target_value = # value needed
      }
    }
  }
}

Missing doc report (experimental)

The following resources have fields missing in documents.

  • google_sql_database_instance
    • Expected Document Path: /website/docs/r/sql_database_instance.html.markdown
    • Fields: [settings.read_pool_auto_scale_config settings.read_pool_auto_scale_config.disable_scale_in settings.read_pool_auto_scale_config.enabled settings.read_pool_auto_scale_config.max_node_count settings.read_pool_auto_scale_config.min_node_count settings.read_pool_auto_scale_config.scale_in_cooldown_seconds settings.read_pool_auto_scale_config.scale_out_cooldown_seconds settings.read_pool_auto_scale_config.target_metrics settings.read_pool_auto_scale_config.target_metrics.metric settings.read_pool_auto_scale_config.target_metrics.target_value]

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 131
Passed tests: 102
Skipped tests: 26
Affected tests: 3

Click here to see the affected service packages
  • sql

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccSqlDatabaseInstance_MysqlReadPoolAutoScaleEnableDisableSuccess
  • TestAccSqlDatabaseInstance_MysqlReadPoolEnableDisableSuccess
  • TestAccSqlDatabaseInstance_PostgresReadPoolAutoScaleChangeNodeCount

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccSqlDatabaseInstance_MysqlReadPoolAutoScaleEnableDisableSuccess [Debug log]
TestAccSqlDatabaseInstance_PostgresReadPoolAutoScaleChangeNodeCount [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccSqlDatabaseInstance_MysqlReadPoolEnableDisableSuccess [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@olmoods
Copy link
Contributor Author

olmoods commented Oct 14, 2025

FWIW I'm aware TestAccSqlDatabaseInstance_MysqlReadPoolEnableDisableSuccess is failing (before this PR) and will send out a separate fix

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Oct 14, 2025
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Oct 15, 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 ( 3 files changed, 469 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 3 files changed, 469 insertions(+), 4 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_sql_database_instance (203 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_sql_database_instance" "primary" {
  node_count = # value needed
  settings {
    read_pool_auto_scale_config {
      disable_scale_in           = # value needed
      enabled                    = # value needed
      max_node_count             = # value needed
      min_node_count             = # value needed
      scale_in_cooldown_seconds  = # value needed
      scale_out_cooldown_seconds = # value needed
      target_metrics {
        metric       = # value needed
        target_value = # value needed
      }
    }
  }
}

Missing doc report (experimental)

The following resources have fields missing in documents.

  • google_sql_database_instance
    • Expected Document Path: /website/docs/r/sql_database_instance.html.markdown
    • Fields: [settings.read_pool_auto_scale_config settings.read_pool_auto_scale_config.disable_scale_in settings.read_pool_auto_scale_config.enabled settings.read_pool_auto_scale_config.max_node_count settings.read_pool_auto_scale_config.min_node_count settings.read_pool_auto_scale_config.scale_in_cooldown_seconds settings.read_pool_auto_scale_config.scale_out_cooldown_seconds settings.read_pool_auto_scale_config.target_metrics settings.read_pool_auto_scale_config.target_metrics.metric settings.read_pool_auto_scale_config.target_metrics.target_value]

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 131
Passed tests: 104
Skipped tests: 26
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_MysqlReadPoolEnableDisableSuccess

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccSqlDatabaseInstance_MysqlReadPoolEnableDisableSuccess [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

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.

LGTM! Failing test has an existing ticket and is unrelated.

Verified that missing fields are accounted for, not captured properly due to being supplied to SQL DB tests via string formatting.

Edge scenarios are handled correctly via lines like

return make([]interface{}, 0) // Explicitly return empty slice

Thanks for the contribution and detailed docs!

@NickElliot NickElliot added this pull request to the merge queue Oct 15, 2025
Merged via the queue into GoogleCloudPlatform:main with commit f20c0f0 Oct 15, 2025
26 of 27 checks passed
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.

4 participants