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

Question about idempotent #6

Closed
shenlongxing opened this issue Sep 11, 2019 · 3 comments
Closed

Question about idempotent #6

shenlongxing opened this issue Sep 11, 2019 · 3 comments

Comments

@shenlongxing
Copy link

I have read the source code of redis cluster proxy. And as far as I am concerned, there may be situations that idempotent is not guaranted.
The proxy uses threads pool (default 8) to receive and dispatch commands and since thread is chosen by round robin, the commands may not be executed in the exactly same order as the client sent due to threads connection error or something alike.

@artix75
Copy link
Contributor

artix75 commented Sep 27, 2019

Every client is assigned to a single thread, so every command from a specific client is always dispatched to the cluster by the same thread, and since the connection to a single node of the cluster is thread-specific there should be no issues.
Furthermore, since by default every thread dispatches its queries in a multiplexed context (they come from different clients), the order of the replies is guaranteed by their internal ID that is handled by a radix tree.
In every test I've made I've never had issues related to commands order.
I hope I've matched your concerns, anyway feel free to tell me your impressions about what you consider weak.
Thank you.

@antirez
Copy link

antirez commented Oct 24, 2019

@shenlongxing I wonder if Fabio's reply is satisfying for you, the fact that the thread is sticky from the POV of the client, and the ID system in the radix tree that orders everything. If it's ok we can close this one.

@shenlongxing
Copy link
Author

@artix75 @antirez Thanks for the reply, it is ok to me.

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

No branches or pull requests

3 participants