redis: add support for hostnames returned in cluster_slots response#19541
redis: add support for hostnames returned in cluster_slots response#19541mattklein123 merged 23 commits intoenvoyproxy:mainfrom huntsman90:elasticache_redis_hostnames
Conversation
Signed-off-by: Konstantin Belyalov <arsenicus@mail.ru> Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
Signed-off-by: Konstantin Belyalov <arsenicus@mail.ru> Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
Signed-off-by: Konstantin Belyalov <arsenicus@mail.ru> Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
Signed-off-by: Konstantin Belyalov <arsenicus@mail.ru> Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
- refactor code to make more readable, and simplify recursion logic - do not fail entire resolution if a replica resolution fails - add test, fix existing one Co-authored-by: Konstantin Belyalov <arsenicus@mail.ru> Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
|
Hi @huntsman90, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
…ponse using addrInfo() - ran code formatter, which changed some unrelated code, but it mostly looks fine. Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
|
Hey @snowp redis is owned by Matt, but could you field reviews until he's back? |
snowp
left a comment
There was a problem hiding this comment.
Thanks for working on this! Some comments to get you started
/wait
- refactor `resolveReplicas` to resolve all the replicas in a loop, in parallel - add docstrings for `resolveReplicas` and `resolveHostname` Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
Thanks for the review @snowp . I have incorporated all the suggestions. I've left a few comments/questions for the ones left unresolved. NOTE: I'm not sure of the review-comment-resolve process here; so, apologies if me resolving the comments slows the review process for you. Additionally, I have a question: It says that the branch has conflicts that need resolution. However, would rebasing on |
Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
I fixed this via a merge of |
snowp
left a comment
There was a problem hiding this comment.
Thanks for working on this! Some high level comments, I would love to be able to simplify this code a little bit
|
Also FYI @mattklein123 since you're back now and Redis belongs to you :) |
|
PTAL @snowp to either take another pass, or hand off to codeowner |
|
We've been talking over DM, I believe this one is still waiting for an integration test? /wait |
Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
|
@mattklein123 Can you keep an eye on this as I'll be out starting next week? |
Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
|
Hello! 👋 I've added the integrations test, and I believe the PR is ready for a review now. Please take a look when possible @mattklein123 . Thanks! |
taking over review, integration test added
mattklein123
left a comment
There was a problem hiding this comment.
Thanks generally this LGTM. In addition to my comment in the code, can you please also add a release note as well as update https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/other_protocols/redis.html to make it more clear that we now support this.
Thank you.
/wait
Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com>
|
@mattklein123 the PR is updated. Please recommend updates to the documentation added, if required. |
…voyproxy#20217) Signed-off-by: Sai Teja Duthuluri <dsaiteja1908@gmail.com> Signed-off-by: kuochunghsu <kuochunghsu@pinterest.com>
Commit Message:
Currently,
CLUSTER SLOTSresponse is expected to contain the IP address of each redis host in the response.However, response from AWS Elasticache contains the hostnames instead. This PR adds support to DNS resolve the hostnames asynchronously before cluster slot updates are applied.
Co-authored-by: Konstantin Belyalov arsenicus@mail.ru
Additional Description:
This PR builds directly on top of #19192 and fixes the bugs in it.
To read this PR, the best starting point may be the
onResponsemethod inredis_cluster.ccand read from there. Almost all of the logic change is confined toredis_cluster.cc.The failure scenarios while resolving the hostnames are listed below:
update_failure_is incremented.Testing:
Fixes #8440