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

Introducing periodic topology mechanism for JedisCluster (#3596) #3604

Open
wants to merge 2 commits into
base: 4.x
Choose a base branch
from

Conversation

yangbodong22011
Copy link
Collaborator

backport #3596 to 4.x

The main changes in this PR are as follows:

1. Add `topologyRefreshEnabled` and `topologyRefreshPeriod` to control the periodic topology refresh mechanism.
2. `topologyRefreshExecutor` is a single-threaded executor responsible for running `TopologyRefreshTask`.
3. Add `checkClusterSlotSequence` to check whether the cluster slots returned by the server are consecutive and there are no duplicates.
4. [Test] In JedisClusterTestBase, `CLUSTER RESET SOFT` was changed to `HARD`, because SOFT cannot clean up the Redis Cluster configuration and may cause a crash. Please refer to redis/redis#12701
5. [Test] Adjust the cluster-node-timeout in the Makefile to 15s, consistent with the default configuration of Redis.

---------

* Introducing periodic topology mechanism for JedisCluster

* Apply suggestions from sazzad16

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

* Remove topologyRefreshEnabled

* Apply suggestions from sazzad16

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

* remove save topologyRefreshPeriod

* Move INIT_NO_ERROR_PROPERTY to JedisCluster

* add timeout for clusterPeriodTopologyRefreshTest

* Update src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

---------

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (3577f93) 67.37% compared to head (9d89aff) 67.42%.

❗ Current head 9d89aff differs from pull request most recent head 816e58f. Consider uploading reports for the commit 816e58f to get more accurate results

Files Patch % Lines
...ava/redis/clients/jedis/JedisClusterInfoCache.java 76.74% 4 Missing and 6 partials ⚠️
...main/java/redis/clients/jedis/ClusterPipeline.java 0.00% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                4.x    #3604      +/-   ##
============================================
+ Coverage     67.37%   67.42%   +0.04%     
- Complexity     4785     4798      +13     
============================================
  Files           272      272              
  Lines         15421    15467      +46     
  Branches        981      991      +10     
============================================
+ Hits          10390    10428      +38     
- Misses         4603     4607       +4     
- Partials        428      432       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aarengee
Copy link

@sazzad16 when can this be released ?

thanks for the feature @yangbodong22011 :) <3

@sazzad16
Copy link
Collaborator

@aarengee
This feature is available since version 5.1.0.
Currently there is no planned feature release for 4.x line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants