[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Flavio Paiva Junqueira updated ZOOKEEPER-127:
---------------------------------------------

    Attachment: ZOOKEEPER-127.patch

Because 131 was committed, I had to regenerate this patch. Also, it gave me 
time to write a unit test for FastLeaderElection. I used the one Ben wrote for 
the old leader election as a basis. 

This patch:
- Fixes issues with QuorumCnxManager, in particular, servers can have different 
ports for leader election, and QuorumCnxManager uses server id to identify 
peers instead of IP address;
- Remove the challenge used in QuorumCnxManager. QuorumCnxManager uses a 
randomly generated challenge to decide whether to keep or not to keep a 
connection. This patch eliminates this challenge, and uses server id instead. 
As server id is supposed to be unique, it serves the same purpose, although it 
is simpler, and more reliable;
- Does a general cleanup of QuorumCnxManager. I have tried to address the 
comments of Austin;
- Changes the format of the ZooKeeper configuration file. Now we specify the 
leader election port as the third parameter of a server specification, as 
described in the initial description of this jira;
- Fixes a bug in FastLeaderElection. Because it uses multiple threads, there is 
currently the possibility that a peer sends inconsistent information to other 
peers;
- Adds a unit test to FastLeaderElection based on the one Ben wrote;
- Finally, because of the patch of jira 131, it touch some other parts, like 
LETest.java to comply with my changes.

 

> 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, 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=10.20.9.254:2881
>   server.2=10.20.9.9:2882
>   server.3=10.20.9.254:2883
> Server 3 was observed trying to make a connection to host 10.20.9.9 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