-
Notifications
You must be signed in to change notification settings - Fork 19
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
Initial node connection should be influenced by node priority #25
Comments
Just to recap, the first connection right now occurs as follows:
In order to switch to the best node at this moment, I would call I see a few points that need consideration:
In the light of this, I suggest the following:
This could be done by writing a new node prioritizer strategy and using it for the first check, called maybe What do you think? |
I like your suggestion, goes in line with connect asap, but if Disque is telling us the node is no good (maybe it's leaving the cluster), then and only then switch away. While we modify the connection code we might as well end up adding support for #28 so when a specific command tells us that the node we sent that command to is actually leaving the cluster, then issue a reconnect to another node (which in our case, if we implement priorities as you mention, would simply mean just triggering a reconnect) |
I think it is not possible to connect to a leaving node. If the connection, authentication, or HELLO return an error (and thus throw an exception), the node is skipped and we try to connect to the next one. The initial connection logic is in Both use a similar pattern:
We however need to support |
The documentation of the
HELLO
command states that a priority is given for each node in the cluster, and that this priority is a number where lower is better, which means a node is more available.This can be used to influence the initial node connection.
The text was updated successfully, but these errors were encountered: