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

Renew cluster slots depends on startNodes (ii) #2644

Closed
wants to merge 3 commits into from

Conversation

sazzad16
Copy link
Collaborator

No description provided.

yangbodong22011 and others added 2 commits September 9, 2021 20:42
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) {
Copy link
Collaborator

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.

Copy link
Collaborator Author

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,
Copy link
Collaborator

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?

Copy link
Collaborator Author

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 :)

@sazzad16 sazzad16 closed this Sep 10, 2021
@sazzad16 sazzad16 deleted the refresh-on-startNodes-2 branch September 10, 2021 15:21
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.

2 participants