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

Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3545

Closed
wants to merge 2 commits into from
Closed

Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3545

wants to merge 2 commits into from

Conversation

chenshi5012
Copy link
Contributor

sentinel mode, lost "+switch-master" message, should client add watchdog thread #3525
please check this, JedisSentinelPool / SentineledConnectionProvider provider monitor master-slave failover by subscribe the message from “+switch-master”。

this pr modify master-slave failover monitor,Two listening mechanisms are provided, one is the default subscription mechanism and the other is the active detection mechanism;
When due to network reasons, the client loses the subscription message and the main node connection of the jedis factory is still not switched, it will cause the connection to be unavailable.

  1. SentinelMasterSubscribeListener the default listener
  2. SentinelMasterActiveDetectListener the active detect listener

you can specify which listener to use; or open both. default is SubscribeListener,
`

SentinelPoolConfig config = new SentinelPoolConfig();
config.setEnableActiveDetectListener(true);   // default off 
config.setEnableDefaultSubscribeListener(true); // default on 
config.setActiveDetectIntervalTimeMillis(5*1000); // default 5s 
config.setSubscribeRetryWaitTimeMillis(5*1000); // default  5s 

JedisSentinelPool pool = new JedisSentinelPool(MASTER_NAME, sentinels, config, 1000,
        "foobared", 2);

`

@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2023

Codecov Report

Patch coverage: 49.19% and project coverage change: -0.19% ⚠️

Comparison is base (4d9f78f) 67.38% compared to head (d0d31ba) 67.20%.
Report is 2 commits behind head on 4.x.

❗ Current head d0d31ba differs from pull request most recent head 33c6ece. Consider uploading reports for the commit 33c6ece to get more accurate results

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

Additional details and impacted files
@@             Coverage Diff              @@
##                4.x    #3545      +/-   ##
============================================
- Coverage     67.38%   67.20%   -0.19%     
- Complexity     4758     4780      +22     
============================================
  Files           270      273       +3     
  Lines         15332    15400      +68     
  Branches        968      975       +7     
============================================
+ Hits          10331    10349      +18     
- Misses         4578     4625      +47     
- Partials        423      426       +3     
Files Changed Coverage Δ
...ents/jedis/SentinelMasterActiveDetectListener.java 0.00% <0.00%> (ø)
...a/redis/clients/jedis/resps/GeoRadiusResponse.java 67.85% <25.00%> (-18.51%) ⬇️
...n/java/redis/clients/jedis/SentinelPoolConfig.java 47.05% <47.05%> (ø)
...clients/jedis/SentinelMasterSubscribeListener.java 57.14% <57.14%> (ø)
.../jedis/providers/SentineledConnectionProvider.java 84.21% <65.21%> (+8.02%) ⬆️
...in/java/redis/clients/jedis/JedisSentinelPool.java 71.12% <69.23%> (+4.08%) ⬆️
...ava/redis/clients/jedis/search/RediSearchUtil.java 89.47% <94.44%> (+3.11%) ⬆️

... and 3 files with indirect coverage changes

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

@sazzad16
Copy link
Collaborator

@chenshi5012

  1. We usually accept new features only for the master branch. You're currently targeting 4.x branch.
  2. Instead of creating new PRs over and over again for same purpose (Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3541, Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3543, this Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3545), you can just push to your respective branch (force push if necessary) and the PR will be updated.

@chenshi5012
Copy link
Contributor Author

@chenshi5012

  1. We usually accept new features only for the master branch. You're currently targeting 4.x branch.
  2. Instead of creating new PRs over and over again for same purpose (Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3541, Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3543, this Add active detection in sentinel mode,Reconstruct sentinel mode Listener #3545), you can just push to your respective branch (force push if necessary) and the PR will be updated.

thanks ,i will work on it as soon as possible.

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

Successfully merging this pull request may close these issues.

3 participants