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

Detail the issue of redirection occurring within a transaction. #168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

soloestoy
Copy link
Member

Copy link
Contributor

@zuiderkwast zuiderkwast left a 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.

@soloestoy
Copy link
Member Author

feel free to modify the doc @zuiderkwast , I'm not a native English speaker, haha.

@zuiderkwast
Copy link
Contributor

I'm not a native English speaker, haha.

Me neither. 😜 But I can try.

Comment on lines +130 to +135
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

Copy link
Member

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
Copy link
Member

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?

Comment on lines +130 to +135
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.
Copy link
Member

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.

@zuiderkwast
Copy link
Contributor

@soloestoy Will you reply to the comments? I want to merge this.

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 this pull request may close these issues.

4 participants