-
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 strategy update #2643
Renew cluster slots strategy update #2643
Conversation
@yangbodong22011 Not only this is a breaking change but also backward incompatible.
You are completely disregarding |
This is not actually a behavior visible to the user, so I think we can modify it without having to be compatible with the old (and may cause errors) logic. If it should be compatible, maybe we can add a I guess the reason you think it should be compatible is that the performance of the
This may be a bit difficult, because we did not distinguish whether the type in
|
Practically, yes. But theoretically no; because JedisClusterInfoCache is a public class.
No. If the behavior is changed significantly, we may have to push it for 4.0 instead of 3.x. |
@yangbodong22011 WDYT about #2644 ? |
92014b6
to
fc38c53
Compare
@sazzad16 @dengliming PING, pls have a look when you have time. |
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.
About existing JedisClusterInfoCache constructors, we have to keep those. So, keep these constructors, deprecate these, forward to new constructors (like this(..., ..., (Set<HostAndPort>) null);
and handle startNodes == null
in other methods.
fc38c53
to
7ba0667
Compare
done |
7ba0667
to
7f5efba
Compare
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.
LGTM so far.
Codecov Report
@@ Coverage Diff @@
## master #2643 +/- ##
============================================
- Coverage 55.03% 55.03% -0.01%
- Complexity 3154 3155 +1
============================================
Files 195 195
Lines 12069 12086 +17
Branches 689 690 +1
============================================
+ Hits 6642 6651 +9
- Misses 5200 5206 +6
- Partials 227 229 +2
Continue to review full report at Codecov.
|
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` The new strategy is as follows: 1. First, if jedis(meet JedisRedirectionException) is available, use jedis renew. 2. Then, we use startNodes to try, as long as startNodes is available, whether it is vip, domain, or physical ip, it will succeed. 3. Finally, we go back to the ShuffledNodesPool and try the remaining physical nodes.
7f5efba
to
873562d
Compare
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.
LGTM
@sazzad16 I would like to backport this PR to version 3.9.x, what do you think? |
@yangbodong22011 I may consider it for 3.10.0 |
That's ok, what should I do next? Submit a PR to the 3.x branch? |
That'd be helpful. |
backported from redis#2643
This PR solves #2551, a problem solving scenario is as follows:
vip -> ip1
vip -> ip2
ip1
ip1
, and will never connect toip2
The new strategy is as follows:
whether it is vip, domain, or physical ip, it will succeed.