-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
Expected behavior
Jedis would refresh the elements of nodes map when the cluster nodes changed
Actual behavior
this nodes parameter just add nodes if not exist in map, but not delete nodes when cluster nodes are deleted

Steps to reproduce:
it would cause a problem in this situation:
- create a redis cluster A with 10 master nodes and delete 9 nodes from cluster;
- use the 9 nodes create a new cluster B
- delete some slots from the cluster or give a large latency between client and the cluster A, make sure jedis throw JedisConnectionException;
JedisConnectionException would cause a slot refresh in JedisClusterCommand:
this method would use JedisClusterInfoCache paramter: nodes map values to refresh slot in JedisClusterInfoCache.renewClusterSlots():

There is a high probability(90%) that the jedis client will connect to cluster B because jedis use the cluster B nodes to refresh slot
Jedis version:
3.6.0


