Fix edition downgrade failure for an ENTERPRISE_PLUS instance with da… #12289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently there was an API change to enable data cache by default for
ENTERPRISE_PLUS
edition (both MySQL and Postgres) instances. Whendata_cache_config
was not acomputed
attribute this resulted in acceptance test failures that were fixed in #12096.Now that
data_cache_config
is computed, it stays in the resource state after a downgrade even thoughdata_cache_config
is cleared from the instance metadata. This is a consequence of performing a PATCH (for edition upgrade / downgrade) followed by an UPDATE while ignoring the change in CloudSQL instance settings from the PATCH operation. The downgrade implicitly unsets the data cache config in the API as it is not allowed to be used withENTERPRISE
edition.This PR fixes this issue (edition downgrade failure for an
ENTERPRISE_PLUS
instance with data cache enabled) by persisting thedata_cache_config
received after the PATCH operation for edition upgrade / downgrade. Also fixes hashicorp/terraform-provider-google#20010 asTestAccSqlDatabaseInstance_Edition_Downgrade
can now run.b/375381759
I acknowledge that I have:
make test
andmake lint
in the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)