Skip to content

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

Closed
yangbodong22011 wants to merge 2 commits into
redis:4.xfrom
yangbodong22011:feature-backport-cluster-topology-refresh-4.x
Closed

Introducing periodic topology mechanism for JedisCluster (#3596)#3604
yangbodong22011 wants to merge 2 commits into
redis:4.xfrom
yangbodong22011:feature-backport-cluster-topology-refresh-4.x

Conversation

@yangbodong22011

Copy link
Copy Markdown
Contributor

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

codecov-commenter commented Nov 3, 2023

Copy link
Copy Markdown

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
Copy Markdown

@sazzad16 when can this be released ?

thanks for the feature @yangbodong22011 :) <3

@sazzad16

Copy link
Copy Markdown
Contributor

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

@sazzad16 sazzad16 closed this Dec 24, 2024
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.

4 participants