-
Notifications
You must be signed in to change notification settings - Fork 1.5k
support for envoyproxy #1989
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
support for envoyproxy #1989
Conversation
NickCraver
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I put some tidy suggestions inline - want to add testing here as well but initial is 👍
Co-authored-by: Nick Craver <[email protected]>
Co-authored-by: Nick Craver <[email protected]>
Co-authored-by: Nick Craver <[email protected]>
Co-authored-by: Nick Craver <[email protected]>
Co-authored-by: Nick Craver <[email protected]>
|
Ah, thanks for catching this, I incorrectly made the change in this
version.
…On Thu, Feb 10, 2022 at 5:30 PM Nick Craver ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/StackExchange.Redis/Enums/ServerType.cs
<#1989 (comment)>
:
> @@ -30,6 +34,7 @@ internal static class ServerTypeExtensions
/// </summary>
public static bool HasSinglePrimary(this ServerType type) => type switch
{
+ ServerType.Envoyproxy => true,
Is this one true or false? I got the impression this was a round-robin
desired and not sure about envoy and wasn't sure what *should* happen.
Thoughts?
—
Reply to this email directly, view it on GitHub
<#1989 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAH4RGVNCOGNM5UDXO3VSCTU2RRDJANCNFSM5OCU76XA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Karthick Ramachandran
|
|
Interesting, the failing testcase ( I will also make changes to docker files to test basic envoy connection this week :) |
|
@NickCraver Envoy doesnt seem to have windows binary, that we could run locally using *.cmd file. Do you have any thoughts on how we can get the environment going in Windows Server? The tests are passing in Ubuntu, except for some random flakiness with others. |
|
@rkarthick you can download Envoy for Windows from the following link: |
|
@rkarthick Sorry it's a crazy week this week in particular (bootcamp at work), nice progress here! I think we can use the envoy image instead of installing for better caching/re-use/speed here and only mount our yaml - I think? Is there a reason that approach doesn't work? I'm not too worried about Windows - can help with skipping tests if we don't have the server as an approach there (based on |
|
No worries @NickCraver and thank you for the reply.
The usage of envoy proxy docker container within docker-compose will involve the following changes:
This is because envoy redis cluster instance discovery relies on Hence I decided to install the envoy within the docker image to make the change minimal. Mostly because I havent worked within sentinel before and wasnt sure if modifying the IP address from 127.0.0.1 in nodes.conf to a fixed ipv4 address will have a side effect in it. I could potentially make these changes to see if affects sentinel or other testcases. But it would be great to get your thoughts before I go down that route :). |
|
@rkarthick I think I follow - I agree current is likely the better path, let me get a free evening (been a busy week) to poke at this and get things green. I really appreciate all the effort here, will help get some final polish ideas tested for the build pipeline :) |
|
I noticed the tests took 10 seconds, then noticed it took 2 seconds....whatever the connect timeout is. Will dig into why, but it's indeed exhausting timeouts: |
In waiting for the subscriber connection to connect _when it's not supported_, we were being dumb and waiting the full timeout to proceed. So...don't do that, do the right thing.
|
Well I found a few issues here:
I'll split the above fixes into their own PR as they are existing bugs in connection logic, but getting there! These tests now run instantly - we should probably add some more command testing but looking good on actually connecting now. |
In investigating an issue in #1989, I found a few gaps. Overall: 1. Twemproxy has an out of date CommandMap, which propagated to Envoy. 2. We were expecting both interactive and subscription connections to complete to complete the async handler...but we shouldn't because subscriptions may be disabled. 3. RedisSubscriber changes on the sync path weren't validating the message (asserting the command map has it enabled). This fixes all of the above and adds another test considering all 3.
|
Prepping the fixes to the underlying issues in #2001 - I'll merge |
|
|
||
| RedisCommand.SCRIPT, | ||
|
|
||
| RedisCommand.ECHO, RedisCommand.PING, RedisCommand.QUIT, RedisCommand.SELECT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for catching this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thank you for making these fixes and catching the subscription functionality issue :). I can add a few more command tests over the weekend. Is there a reason why we removed PING though in envoy. Its supported by envoy. |
|
Yep, look at the argument name ;) Please check me for the rest though, it definitely needs more eyes and is probably missing more. |
In investigating an issue in #1989, I found a few gaps. Overall: 1. Twemproxy has an out of date CommandMap, which propagated to Envoy. 2. We were expecting both interactive and subscription connections to complete to complete the async handler...but we shouldn't because subscriptions may be disabled. 3. RedisSubscriber changes on the sync path weren't validating the message (asserting the command map has it enabled). This fixes all of the above and adds another test considering all 3.
| RedisCommand.SCRIPT, | ||
|
|
||
| RedisCommand.ECHO, RedisCommand.PING, RedisCommand.SELECT, | ||
| RedisCommand.ECHO, RedisCommand.SELECT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Nick: Twemproxy supports PING: https://github.com/twitter/twemproxy/blob/master/notes/redis.md#connection
NickCraver
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good now - thanks for this! We can tweak the command map if needed :)
|
This is great. Thank you for getting this into the master :). |
|
@rkarthick Thanks for getting this done! I appreciate the iteration as we found existing issues here <3 |
Envoy proxy for redis: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/other_protocols/redis
Envoy does the heavy lifting of redis cluster instance discovery and partitioning commands among redis cluster instances from the clients to a set of proxy instances. Clients can round robin or randomly select a proxy to connect to and the proxy will do the right thing of picking the right cluster instance for a given command.
Apart from the glue of wiring up the new proxy in Enums and disabling pub/sub for the proxy (similar to Twemproxy), this PR contains the following major change in the primary node selection; When an envoy proxy mode is selected for connection, the check for verifying if the node is master or replica is disabled. In the envoy proxy world we can connect to any proxy instance. All we care about here is ensuring that the load is balanced between the proxy instances (which is accomplished through the current round-robin logic).
@mgravell raised a valid point offline that the order of operations wouldn't be guaranteed in this mode and this is indeed one of the limitation of this approach. The commands that form the foundation for redis transactions (exec, discard, multi, watch, unwatch) (https://redis.io/topics/transactions) are not supported by Envoy (https://github.com/envoyproxy/envoy/blob/main/source/extensions/filters/network/common/redis/supported_commands.h) and hence added to the exclusion list in PR.
The testing is inspired from this PR: #1425. Open to suggestions on that.