Flavio Paiva Junqueira commented on ZOOKEEPER-127:

It happens typically that a follower starts up its follower code before the 
leader is available as a leader, so we get this connection refused exception. 
However, getting it 5 times means that there has been 5 attempts and no 
success, so the follower gave up and started a new leader election.  

By design, the situation that happens with LE 0 should not happen with LEs 1, 
2, or 3, since we use a logical clock to prevent a peer from using stale 
information on potential leaders.  In more detail, if a peer p1 starts a new 
leader election, and asks a peer p2 that believes that 10 is still the leader, 
then peer p1 shouldn't take p2's vote because it corresponds to the value 
decided in a previous election round. Moreover, because 10 is dead, we know 
that is can't vote, so the vote must come from another peer that believes that 
10 is the leader. 

There must be a bug in the leader election code then, so I'll check the code. 

> Use of non-standard election ports in config breaks services
> ------------------------------------------------------------
>                 Key: ZOOKEEPER-127
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-127
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: quorum
>    Affects Versions: 3.0.0
>            Reporter: Mark Harwood
>            Assignee: Flavio Paiva Junqueira
>            Priority: Minor
>             Fix For: 3.0.0
>         Attachments: mhPortChanges.patch, ZOOKEEPER-127.patch, 
> ZOOKEEPER-127.patch, ZOOKEEPER-127.patch
> In QuorumCnxManager.toSend there is a call to create a connection as follows:
>     channel = SocketChannel.open(new InetSocketAddress(addr, port));
> Unfortunately "addr" is the ip address of a remote server while "port" is the 
> electionPort of *this* server.
> As an example, given this configuration (taken from my zoo.cfg)
>   server.1=
>   server.2=
>   server.3=
> Server 3 was observed trying to make a connection to host on port 
> 2883 and obviously failing.
> In tests where all machines use the same electionPort this bug would not 
> manifest itself.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to