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 #3543

Closed
wants to merge 1 commit into from
Closed

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);

`

i am working on the test case.

SentinelMasterListenerTest.zip

image

when Simulate the scenario of switching between active and standby, this will Affects other test cases. can you offer some help to Execute these use cases separately

@chenshi5012
Copy link
Contributor Author

@sazzad16 , hi ,Hoque

can you help me to Run Test Case Separately,
SentinelMasterListenerTest.zip

these case will Affects test case in JedisSentinelPoolTest SentineledConnectionProviderTest .

@chenshi5012
Copy link
Contributor Author

@yangbodong22011 你好,请问怎么 隔离运行 测试用例,有帮助文档吗? 关于workflow
image

@sazzad16 hello,May I ask how to isolate and run test cases? Is there any helpful documentation? About workflow

@sazzad16
Copy link
Collaborator

In your machine, you can do:

mvn -Dtest=TestClassName#testMethodName test

You may also consider:

mvn -Dtest=*Sentinel* test

Here in GitHub PR, you should run all the tests.
This is not ideal, but during ongoing work you can put @Ignore annotation before all other (Sentinel) tests except the one you are working on.

@chenshi5012
Copy link
Contributor Author

In your machine, you can do:

mvn -Dtest=TestClassName#testMethodName test

You may also consider:

mvn -Dtest=*Sentinel* test

Here in GitHub PR, you should run all the tests. This is not ideal, but during ongoing work you can put @Ignore annotation before all other (Sentinel) tests except the one you are working on.

thanks, i will working 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.

2 participants