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

feat: [Redis] add support for data tiering nodes #783

Merged
merged 4 commits into from
Mar 15, 2023

Conversation

zucchinidev
Copy link
Contributor

#184160811

Checklist:

For more information about Node Types and supported Redis versions see
https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html
default: false
prohibit_update: true
Copy link
Contributor

@fnaranjo-vmw fnaranjo-vmw Mar 10, 2023

Choose a reason for hiding this comment

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

Prohibiting updating this field introduces unexpected behaviour:

  • node_type field is updatable
  • if node_type is set to an r6gd node_type but is later changed to a non r6gd node_type,
    data_tiering_enabled either (I don't know which will happen):
    • causes the node_type change to fail
    • node_type change succeeds but data_tiering_enabled: true no longer represents the reality

Choose a reason for hiding this comment

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

@fnaranjo-vmw The node_type change wouldn't succeed as you cannot move from a data_tiering enabled node type to a non-data-tiering node (and vice versa). So I think prohibiting the update in this field actually has the effect of providing rapid feedback to the user.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect. Everything looks nice then!
Great job @zucchinidev !

Copy link
Contributor

@fnaranjo-vmw fnaranjo-vmw Mar 10, 2023

Choose a reason for hiding this comment

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

Hey @pivotal-marcela-campo , do you know if we could encode this logic (changing from data-tiering to non-data tiering and vice-versa) as a terraform tests?
Or this logic only happens in the IAAS, and as such can't be expressed as a terraform test?

redisServiceProviderDisplayName = "VMware"
redisCustomPlanName = "custom-sample"
redisCustomPlanID = "c7f64994-a1d9-4e1f-9491-9d8e56bbf146"
deprecatedCacheSizePlanName = "deprecated-cachesize-sample"
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Maybe by introducing a new line between redisCustomPlanID and deprecatedCacheSizePlanName go formatter wouldn't try to reformat untouched lines to preserve alignment.

Having git/Github diffs only highlight added/changed lines is a big help when reviewing the code.
However, feel free to leave it as it is. But maybe keep it in mind for future commits.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I see you have done some cleanup of the code from cache_size.
I would recommend adding these changes in a different PR to keep this PR focused on the changes needed to make data_tiering work.
Also, feel free to be more strict when reviewing my PRs.
I wouldn't be bothered by you asking me to modify my PR to use less hardcoded strings in tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this PR is small enough that it is ok to leave the cleanup changes in it.

Copy link
Member

Choose a reason for hiding this comment

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

For more information about Node Types and supported Redis versions see
https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html
default: false
prohibit_update: true

Choose a reason for hiding this comment

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

@fnaranjo-vmw The node_type change wouldn't succeed as you cannot move from a data_tiering enabled node type to a non-data-tiering node (and vice versa). So I think prohibiting the update in this field actually has the effect of providing rapid feedback to the user.

@zucchinidev zucchinidev merged commit 92b97d6 into main Mar 15, 2023
@zucchinidev zucchinidev deleted the data_tiering_redis_184160811 branch March 15, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants