-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Clarification about READONLY errors inside a transaction #7014
Comments
I think that It is important to mix transaction with pipelining. It is a server side capability, so you also should use pipelining to send your all commands once. The redis-cli is a simple redis client that does not use pipelining. |
Hi @luin - this looks like an inconsistency indeed, @antirez @yossigo @soloestoy? |
Hi, that's a bug. Fixing. |
Hi, I'm collaborating on a pull request in ioredis repo for handling READONLY errors inside a transaction. I think the behavior is inconsistent with the documentation so I'd just want to make sure here if it's a bug or something intentional.
Current behavior
Given two Redis servers (v5.0.6) A & B, A is the master and B is a read only replica (set up with
replicaof A.host A.port
), run the following commands in redis-cli against B:EXEC
command gives a partial result for the two command, which isn't expected.Expected behavior
I think the whole transaction should be discarded.
In our documentation about transactions:
It seems current behavior (that executing the transaction with the subset of commands queued successfully) is only normal for Redis < 2.6.5.
I checked the code and it seems READONLY is the only case that would fail without flagging the transaction. Is there any reasons behind this? If that's the case I think we should update the documentation accordingly.
https://github.com/antirez/redis/blob/1e16b9384d6aa3680ec5629fc0842ab53bf1655e/src/server.c#L3502-L3510
The text was updated successfully, but these errors were encountered: