-
Notifications
You must be signed in to change notification settings - Fork 37
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
Detail the issue of redirection occurring within a transaction. #168
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: zhaozhao.zz <[email protected]>
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.
Looks good. The English can probably be improved a little.
We should also mention this in the cluster-spec, at least add a link from cluster-spec to here. The cluster spec is what cluster client authors would read and where MOVED is documented.
EXEC can also return -TRYAGAIN and -ASK, right? But that's maybe better to mention in the cluster spec than here.
feel free to modify the doc @zuiderkwast , I'm not a native English speaker, haha. |
Me neither. 😜 But I can try. |
There are some more specific scenarios: in the `MULTI` context, commands are | ||
successfully queued (i.e., `QUEUED` reply is received), but when the `EXEC` command | ||
is executed, it is found that the data needed for these commands does not belong to | ||
the current node (for example, in cluster mode, the accessed slot has been migrated to | ||
another node; in standalone mode, a primary-replica switch has occurred). In this case, | ||
the `EXEC` command will receive a `MOVED` or `REDIRECT` result. |
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.
There are some more specific scenarios: in the `MULTI` context, commands are | |
successfully queued (i.e., `QUEUED` reply is received), but when the `EXEC` command | |
is executed, it is found that the data needed for these commands does not belong to | |
the current node (for example, in cluster mode, the accessed slot has been migrated to | |
another node; in standalone mode, a primary-replica switch has occurred). In this case, | |
the `EXEC` command will receive a `MOVED` or `REDIRECT` result. | |
When the `EXEC` command is processed, the server will check if a failover or slot migration has occurred since queuing the commands. | |
If either event has occurred, a `-MOVED` or `-REDIRECT` error will be returned if needed without processing the transaction. |
I think just being a bit more succinct for what the user will see might make the English problem easier?
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.
can we also clarify when -MOVED
/-REDIRECR
would be expected as well? I feel like the table (option 1) at valkey-io/valkey#895 (comment) is very helpful. It would be great if it could be incorporated in this doc.
MULTI ==> +OK | ||
SET x y ==> +QUEUED | ||
slot {x} is migrated to other node | ||
EXEC ==> -MOVED |
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.
I didn't see the EXECABORT
behavior documented in this file or anywhere in the doc repo. Can we add it here too for completeness?
There are some more specific scenarios: in the `MULTI` context, commands are | ||
successfully queued (i.e., `QUEUED` reply is received), but when the `EXEC` command | ||
is executed, it is found that the data needed for these commands does not belong to | ||
the current node (for example, in cluster mode, the accessed slot has been migrated to | ||
another node; in standalone mode, a primary-replica switch has occurred). In this case, | ||
the `EXEC` command will receive a `MOVED` or `REDIRECT` result. |
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.
can we also clarify when -MOVED
/-REDIRECR
would be expected as well? I feel like the table (option 1) at valkey-io/valkey#895 (comment) is very helpful. It would be great if it could be incorporated in this doc.
@soloestoy Will you reply to the comments? I want to merge this. |
doc for valkey-io/valkey#895