-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Renew cluster slots depends on startNodes (ii) #2644
Conversation
This PR solves redis#2551, a problem solving scenario is as follows: 1) JedisCluster jc = new JedisCluster(vip); // now `vip -> ip1` 2) change `vip -> ip2` 3) renewClusterSlots just use getShuffledNodesPool, that is `ip1` 4) connect to `ip1`, and will never connect to `ip2`
@@ -162,6 +170,19 @@ public void renewClusterSlots(Jedis jedis) { | |||
} | |||
} | |||
} | |||
|
|||
if (startNodes != null) { |
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.
If getShuffledNodesPool
exists, it is almost impossible for the code to come here unless all master and slave nodes in the cluster are unserviceable.
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.
@yangbodong22011 OK, now I have clearer idea about #2643
this(poolConfig, clientConfig, null); | ||
} | ||
|
||
public JedisClusterInfoCache(final GenericObjectPoolConfig<Jedis> poolConfig, |
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.
Do you plan to provide an interface for setting JedisClusterInfoCache
forJedisCluster
?
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'm not planning such idea.
But I won't mind to see a PR :)
No description provided.