[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15225806#comment-15225806
 ] 

Rakesh R commented on BOOKKEEPER-911:
-------------------------------------

Thanks [~arunmk], good analysis.

bq. the ReplicationWorker should shutdown in some cases but the code has a 
change from BOOKKEEPER-594 to explicitly not do it. So it will be good to know 
if we should fix the tests or fix the code
Like described in BK-594, the idea is not to shutdown the ReplicationWorker due 
to an error contacting ZooKeeper, instead it should wait for some backoff time 
and continue running. With this change all the shutdown decisions are unified 
to one place - DeathWatcher daemon, which is responsible for taking any 
shutdown action. yes, we should fix the failing test cases.

bq. Use the AutoRecoveryMain methods so that we can use the Zookeeper 
session-expiry watcher it creates, and also use its shutdown methods. Such 
cases are already covered in AutoRecoveryMainTest.
Here we need ZK reference to simulate disconnection or expiry. You can use 
AutoRecoveryMain to get ZK handle or pass zookeeper object reference to RW and 
simulate session expiry.

{code}
new ReplicationWorker(zk, baseConf, getBookie(0))
{code}

 Test cases should verify that: case-1) ReplicationWorker is still running even 
after hitting ZK#Disconnected event. case-2) Should be able to perform the 
operation once ZK connection re-establishes after a disconnection. case-3) on 
zk session expiry watch notification, DeathWatcher will bring down RW.  I think 
we can remove the unit test which is already taken care through another well 
written test case. I meant, case-3 session expiry behavior is already covered 
through {{AutoRecoveryMainTest#testAutoRecoverySessionLoss}}.

> Fix TestReplicationWorker tests in master
> -----------------------------------------
>
>                 Key: BOOKKEEPER-911
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-911
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-auto-recovery
>    Affects Versions: 4.3.2
>            Reporter: Arun M. Krishnakumar
>            Assignee: Arun M. Krishnakumar
>              Labels: tests
>
> Currently we have the following test failures in master branch:
> Results :
> Failed tests:   
> testRWZKSessionLost[0](org.apache.bookkeeper.replication.TestReplicationWorker):
>  Replication worker should have shut down
>   
> testRWZKSessionLost[1](org.apache.bookkeeper.replication.TestReplicationWorker):
>  Replication worker should have shut down
>   
> testRWZKSessionLost[2](org.apache.bookkeeper.replication.TestReplicationWorker):
>  Replication worker should have shut down
> Tests in error: 
>   
> testRWShutdownOnLocalBookieReadonlyTransition[0](org.apache.bookkeeper.replication.TestReplicationWorker):
>  test timed out after 20000 milliseconds
>   
> testRWShutdownOnLocalBookieReadonlyTransition[1](org.apache.bookkeeper.replication.TestReplicationWorker):
>  test timed out after 20000 milliseconds
>   
> testRWShutdownOnLocalBookieReadonlyTransition[2](org.apache.bookkeeper.replication.TestReplicationWorker):
>  test timed out after 20000 milliseconds
> Tests run: 654, Failures: 3, Errors: 3, Skipped: 0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to