-
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
Address empty cluster slots list when discovering slots #3195
Conversation
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.
It seems reasonable.
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.
Let's use isEmpty()
method.
Fixed, also |
@jgaoIXL Jedis assumes that the But I agree to merge this PR, as a defensive protection. |
src/main/java/redis/clients/jedis/providers/ClusterConnectionProvider.java
Outdated
Show resolved
Hide resolved
@yangbodong22011 I've mistakenly deleted one of your comment/suggestion. Sorry about that. |
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.
The exception should be JedisClusterOperationException
. WIP #3204
src/main/java/redis/clients/jedis/providers/ClusterConnectionProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/redis/clients/jedis/providers/ClusterConnectionProvider.java
Outdated
Show resolved
Hide resolved
…rovider.java Co-authored-by: bodong.ybd <[email protected]>
Co-authored-by: M Sazzadul Hoque <[email protected]>
Co-authored-by: M Sazzadul Hoque <[email protected]>
Co-authored-by: M Sazzadul Hoque <[email protected]>
…rovider.java Co-authored-by: M Sazzadul Hoque <[email protected]>
Thank you. When are we supposed to see a stable release with this fix? @yangbodong22011 |
@jgaoIXL We don't have an exact date yet but this change is available in 4.4.0 snapshot. |
This is a bug that I encountered where
renewClusterSlots
was called when one node was removed from the cluster. The removed node happened to get selected to do thediscoverClusterSlots
. Because the removed node return no cluster slots, we have an empty slots cache, and there is no recovery possible from there since the nodes and slots map are all empty.I think it makes sense to return if slotsInfo is size 0 because under no normal circumstances, the cluster should have 0 cluster info provided, it can only mean one thing, which is you are pointing to a node that is not in the cluster.