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

Transactions are not well supported in Envoy Redis proxy scenario #2823

Closed
KirilNN opened this issue Dec 11, 2024 · 3 comments · Fixed by #2824
Closed

Transactions are not well supported in Envoy Redis proxy scenario #2823

KirilNN opened this issue Dec 11, 2024 · 3 comments · Fixed by #2824

Comments

@KirilNN
Copy link

KirilNN commented Dec 11, 2024

Hello folks!

We are using SE.Redis client to connect to Envoy Redis proxy. We recently stumbled upon the following issue where our transactions started failing with an error. The minimum repro code is here:

var transaction = cache.CreateTransaction();
            
transaction.AddCondition(Condition.StringEqual("some_key", 1));
            
_ = transaction.StringIncrementAsync("some_key");
_ = transaction.StringSetAsync("some_key", + 1);
var result = await transaction.ExecuteAsync();

When the above is execute against Envoy Redis proxy we observe the following error

Unhandled exception. System.AggregateException: One or more errors occurred. (This operation has been disabled in the command-map and cannot be used: UNWATCH)

The problem comes from the fact that Envoy does not support the UNWATCH command, so maybe this can be replaced by DISCARD in the client, in order to make it compatible with Envoy? Will this be a viable option?

Any help is appreciated!

@dbarbosapn
Copy link
Contributor

We'll try this one out envoyproxy/envoy#37620 and if it's viable, we can close this issue 😃

@dbarbosapn
Copy link
Contributor

dbarbosapn commented Dec 12, 2024

Quick update on this: After further investigation, DISCARD won't be a solution. Because: MULTI\r\nDISCARD\r\n does not get propagated to the underlying Redis cluster from Envoy, while WATCH does.

Meaning:
WATCH <key> <-- sent to Redis
MULTI <-- Not sent
DISCARD/EXEC <-- Not sent

will not clear the watch unless there is at least one operation inside the transaction.

@mgravell
Copy link
Collaborator

Ah yes, I can understand why they would do that; so: I think this is additional fuel for "this needs to be fixed in Envoy"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants