BourneHan created ZOOKEEPER-2435:
------------------------------------

             Summary: miss event when the leader stop
                 Key: ZOOKEEPER-2435
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2435
             Project: ZooKeeper
          Issue Type: Bug
          Components: build
    Affects Versions: 3.4.6
            Reporter: BourneHan
            Priority: Minor


Hi All, 

In my projects, I use three ZooKeeper server as an ensemble:
zk1 as a follower on 192.168.25.221,
zk2 as a follower on 192.168.25.222,
zk3 as the leader on 192.168.25.223.
My two programs using ZooKeepers C client run on 192.168.25.221 and 
192.168.25.222.

When watched the ZOO_CONNECTED_STATE, my program will use the zookeeper to 
obtain a lock do the following:
1. Create a ZOO_EPHEMERAL | ZOO_SEQUENCE node under '/Lock/'.
2. Call getChildren( ) on the '/Lock/' node.
3. If the pathname created in step 1 has the lowest sequence number suffix, the 
program has the lock and do something,then release the lock simply delete the 
node created in step 1.
4. The program calls exists() with the watch flag set on the lowest sequence 
number node.
5. if exists( ) returns false, go to step 2. Otherwise, wait for a 
notification(ZOO_DELETED_EVENT) for the pathname from the previous step before 
going to step 2.

When I stop a follower such as zk1/zk2, everything is ok, my programs on 
192.168.25.221 and 192.168.25.222 do its work orderly under the lock's control.

When I stop the leader such as zk3(I have restarted zk1/zk2), my program on 
192.168.25.221 got the lock and release it normally, and my program on 
192.168.25.222 detected existence of the node 
created by the program on 192.168.25.221, but keep waiting and can't receive 
the ZOO_DELETED_EVENT notification.

Does anyone else see the same problem?




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

Reply via email to