woaishixiaoxiao opened a new pull request #398:
URL: https://github.com/apache/curator/pull/398


   When I use the LeaderLatch to select leader,  there is a double-leader 
phenomenon.
   The timeline is as follows:
   1. The zk cluster switch leader node bescause of zxid overflow
   2. A client(not leader befor zxid overflow) and B client(is leader before 
zxid overflow) enter the suspend state, B client set  its leader status to false
   3. B client enter the reconnect state, call the reset function.  Delete its 
old path.
   4. A client enter the reconnect state  and receive preNodeDeleteEvent.  Then 
getChildren from zkServer.  Find itself is the smallest number and set itself 
as a leader.
   5. B client create a new temporary node  and then getChildren from zkServer. 
 Find itself not the node with the smallest serial number and listen to the 
previous node delete event.
   6. A client delete its old path.
   7. B client receive the preNodeDeleteEvent. then getchildren from zkServer. 
Find itself is the smallest sequence number and then set itself as a leader
   8. A client create  a new temporary node  and then getChildren from 
zkServer.  Find itself not the node with the smallest serial number and listen 
to the previous node delete event. but it doesn't  set itself as a non-leader 
state. because of the fourth step operation, A still is leader state now.
   now  A client and B client are  the leader at the same time 
   
    
    
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@curator.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to