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

r/aws_elasticache_replication_group: Add a DiffSuppressFunc to the en… #15702

Conversation

shuheiktgw
Copy link
Collaborator

@shuheiktgw shuheiktgw commented Oct 18, 2020

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

Closes #15625

Release note for CHANGELOG:

resource/aws_elasticache_replication_group: Add a DiffSuppressFunc to the engine_version field

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_redisEngineVersion6x''
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSElasticacheReplicationGroup_redisEngineVersion6x -timeout 120m
=== RUN   TestAccAWSElasticacheReplicationGroup_redisEngineVersion6x
=== PAUSE TestAccAWSElasticacheReplicationGroup_redisEngineVersion6x
=== CONT  TestAccAWSElasticacheReplicationGroup_redisEngineVersion6x
--- PASS: TestAccAWSElasticacheReplicationGroup_redisEngineVersion6x (643.37s)
PASS

Added a diff suppression function for the engine_version field. Thank you for your review!

@shuheiktgw shuheiktgw requested a review from a team October 18, 2020 05:51
@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/elasticache Issues and PRs that pertain to the elasticache service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 18, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 18, 2020
if len(versions) == 2 {
major, minor := versions[0], versions[1]

if minor == "x" && strings.HasPrefix(old, major) {
Copy link
Contributor

@ktham ktham Dec 18, 2020

Choose a reason for hiding this comment

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

What if someone created Redis with "5.0.5" and then later changed it to "5.x"? I wouldn't expect someone to actually do that, but if someone did, rather than getting an expected apply-time error, your DiffSuppressFunc might actually cause TF ignore that change if I follow your code correctly.

I think what you want to do is to compare the old major version and the new major version, check that it's >= 6, then return true if the both major versions are equal and the new minor version == "x".

I.e. We want to suppress changes for6.0.5 -> 6.x - we'd check that the major versions are equal, the major version is >=6, and new minor version == "x".

However, TF should NOT suppress changes for 5.0.5 -> 5.x, the expectation is that this should lead to an apply-time error

Base automatically changed from master to main January 23, 2021 00:59
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:59
@demolitionmode
Copy link
Contributor

@shuheiktgw Awesome work on the fix, please could you address #15702 (comment)

@gdavison gdavison self-assigned this Feb 11, 2021
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Feb 13, 2021
@shuheiktgw
Copy link
Collaborator Author

@ktham @demolitionmode Sorry I haven't noticed your comments for so long! I've fixed it now!

@ktham
Copy link
Contributor

ktham commented Feb 17, 2021

Awesome, thank you! @gdavison when you get a chance, can you review?

@demolitionmode
Copy link
Contributor

@gdavison do you know a rough lead time for reviewing this please?
Also, @shuheiktgw it looks like there are now conflicts with the main branch that you may have to resolve.

@jseiser
Copy link
Contributor

jseiser commented Mar 30, 2021

What needs done to push this over the line?

@ktham
Copy link
Contributor

ktham commented Apr 6, 2021

@gdavison hate to ping/bother you again ☹️ , but as I'm seeing other PR's getting merged and no movement on this one for 6 months which fixes a bug that affects many of us using TF to manage Elasticache, is this going to be reviewed and merged anytime soon?

@mrudrara
Copy link

mrudrara commented Apr 8, 2021

This needs to be prioritized

@YakDriver YakDriver removed the needs-triage Waiting for first response or review from a maintainer. label Apr 13, 2021
@gdavison
Copy link
Contributor

Thanks for the PR, @shuheiktgw. We've had some discussions on the team about the best way to handle the new way AWS is handling Redis versions for ElastiCache. We've decided that the best approach in this case is to have separate fields for the requested version (engine_version) and the running version (engine_version_actual). I've implemented this in PR #18920.

In addition, this makes the behaviour consistent across aws_elasticache_cluster and aws_elasticache_replication_group: aws_elasticache_replication_group now also allows version downgrades by re-creating the replication group, aws_elasticache_cluster also supports version 6.x for Redis. aws_elasticache_global_replication_group is also updated to match the engine_version_actual parameter.

Thanks again!

@gdavison gdavison closed this Apr 16, 2021
@ghost
Copy link

ghost commented May 17, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/elasticache Issues and PRs that pertain to the elasticache service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticache redis 6.x support
7 participants