Introducing periodic topology mechanism for JedisCluster#3596
Conversation
b50121f to
3100eb8
Compare
3100eb8 to
2a46e65
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3596 +/- ##
============================================
+ Coverage 71.46% 71.49% +0.02%
- Complexity 4848 4860 +12
============================================
Files 288 288
Lines 15464 15511 +47
Branches 1095 1105 +10
============================================
+ Hits 11051 11089 +38
- Misses 3934 3938 +4
- Partials 479 484 +5
☔ View full report in Codecov by Sentry. |
|
@sazzad16 The PR is now available for review, and I have updated the top comments with more details, please take a look at it when you are free. |
|
notice: #3597 has been included in this PR. |
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
f7f2c5a to
9f9f677
Compare
| socket.connect(new InetSocketAddress(host.getHostAddress(), hostAndPort.getPort()), connectionTimeout); | ||
| // Passing 'host' directly will avoid another call to InetAddress.getByName() inside the InetSocketAddress constructor. | ||
| // For machines with ipv4 and ipv6, but the startNode uses ipv4 to connect, the ipv6 connection may fail. | ||
| socket.connect(new InetSocketAddress(host, hostAndPort.getPort()), connectionTimeout); |
There was a problem hiding this comment.
[Adding for future reference:]
Please check #3597 for more information about this change.
|
@sazzad16 I will backport it to 4. x and 3. x, WDYT? |
|
@yangbodong22011 I think I can manage 4.x. You can do it if you want. I'm not doing it now because there will be a patch release for 4 and I don't want to manage more branches (if I can). About 3.x, I doubt if there will ever be a new 3 minor release. |
Thank you, that would be great. p.s. I took the initiative to propose a backport, on the one hand because you are busy, and on the other hand, to truly complete it.
I believe that this PR is not only an enhancement, but also a fix, and it is worth releasing a 3. x version. If you agree, I can backport to 3.x. |
|
You can craft both backport PRs if you want. But I can't promise a new 3 release. |
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>
Jedis added support of topology refresh and providing a period on which jedis will refresh node topology of cluster. This was done from jedis version v5.1.0 https://github.com/redis/jedis/releases/tag/v5.1.0 In pr: redis/jedis#3596
Jedis added support of topology refresh and providing a period on which jedis will refresh node topology of cluster. This was done from jedis version v5.1.0 https://github.com/redis/jedis/releases/tag/v5.1.0 In pr: redis/jedis#3596 Signed-off-by: Bharat Agarwal <agarwalbharat68@gmail.com>
solves #3595
EDIT: The main changes in this PR are as follows:
topologyRefreshEnabledandtopologyRefreshPeriodto control the periodic topology refresh mechanism.topologyRefreshExecutoris a single-threaded executor responsible for runningTopologyRefreshTask.checkClusterSlotSequenceto check whether the cluster slots returned by the server are consecutive and there are no duplicates.CLUSTER RESET SOFTwas changed toHARD, because SOFT cannot clean up the Redis Cluster configuration and may cause a crash. Please refer to [CRASH] Cluster CLUSTERMSG_EXT_TYPE_FORGOTTEN_NODE redis#12701