[
https://issues.apache.org/jira/browse/ZOOKEEPER-2164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17032348#comment-17032348
]
Mate Szalay-Beko commented on ZOOKEEPER-2164:
---------------------------------------------
I also reproduced the problem using
[https://github.com/symat/zookeeper-docker-test]
I compiled with OpenJDK 8u212 and tested runtime with OpenJDK 8u222.
I found the same problem for both the released 3.5.5 branch and also for the
current master branch.
My first test (on 3.5.5):
- starting a 3 node cluster
- the status I see: zoo1: follower, zoo2: follower, *zoo3: leader*
- restarting the container for zoo3, the cluster recovered
- the status I see: *zoo1: leader*, zoo2: follower, zoo3: follower
- restarting the container for zoo1, the cluster didn't recover fully (I
waited for a few minutes)
- the status I see: {color:#FF0000}*zoo1: 'This ZooKeeper instance is not
currently serving requests'*{color}, *zoo2: leader*, zoo3: follower
My second test (on the master branch):
- starting a 3 node cluster
- the status I see: zoo1: follower, zoo2: follower, *zoo3: leader*
- restarting the container for zoo3, the cluster recovered
- the status I see: zoo1: follower, *zoo2: leader*, zoo3: follower
- restarting the container for zoo2, the cluster didn't recover fully (I
waited for a few minutes)
- the status I see: zoo1: follower, {color:#FF0000}*zoo2: 'This ZooKeeper
instance is not currently serving requests'*{color}, *zoo3: leader*
[~hdeng], [[email protected]] are you working on this? If not, then I
will fix it, but I want to avoid double work...
> fast leader election keeps failing
> ----------------------------------
>
> Key: ZOOKEEPER-2164
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2164
> Project: ZooKeeper
> Issue Type: Bug
> Components: leaderElection
> Affects Versions: 3.4.5
> Reporter: Michi Mutsuzaki
> Priority: Major
> Fix For: 3.7.0, 3.5.8
>
>
> I have a 3-node cluster with sids 1, 2 and 3. Originally 2 is the leader.
> When I shut down 2, 1 and 3 keep going back to leader election. Here is what
> seems to be happening.
> - Both 1 and 3 elect 3 as the leader.
> - 1 receives votes from 3 and itself, and starts trying to connect to 3 as a
> follower.
> - 3 doesn't receive votes for 5 seconds because connectOne() to 2 doesn't
> timeout for 5 seconds:
> https://github.com/apache/zookeeper/blob/41c9fcb3ca09cd3d05e59fe47f08ecf0b85532c8/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java#L346
> - By the time 3 receives votes, 1 has given up trying to connect to 3:
> https://github.com/apache/zookeeper/blob/41c9fcb3ca09cd3d05e59fe47f08ecf0b85532c8/src/java/main/org/apache/zookeeper/server/quorum/Learner.java#L247
> I'm using 3.4.5, but it looks like this part of the code hasn't changed for a
> while, so I'm guessing later versions have the same issue.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)