You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Alexander Shraer (JIRA)" <ji...@apache.org> on 2013/10/11 01:42:42 UTC

[jira] [Commented] (ZOOKEEPER-1633) Introduce a protocol version to connection initiation message

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13792114#comment-13792114 ] 

Alexander Shraer commented on ZOOKEEPER-1633:
---------------------------------------------

Seems like there is a small bug in the patch. Instead of  "if (sid < 0) {" it should say "if (sid < -1)" because of the special ObserverId which is -1. 

> Introduce a protocol version to connection initiation message
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1633
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1633
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>            Reporter: Alexander Shraer
>            Assignee: Alexander Shraer
>             Fix For: 3.4.6
>
>         Attachments: ZOOKEEPER-1633.patch, ZOOKEEPER-1633-v4.patch, ZOOKEEPER-1633-v4.patch, ZOOKEEPER-1633-ver2.patch, ZOOKEEPER-1633-ver3.patch
>
>
> Currently the first message a server sends to another server includes just one field - the server's id (long). This is in QuorumCnxManager.java. This makes changes to the information passed during this initial connection very difficult. This patch will change the first field of the message to be a protocol version (a negative number that can't be a server id). The second field will be the server id. The third field is number of bytes in the remainder of the message. A 3.4 server will read the first field as before, but if this is a negative number it will read the second field to find the server id, and then remove the remainder of the message from the stream. This will not affect 3.4 since 3.4 and earlier servers send just the server id (so the code in the patch will not run unless there is a server > 3.4 trying to connect). This will, however, provide the necessary flexibility for future releases as well as an upgrade path from 3.4



--
This message was sent by Atlassian JIRA
(v6.1#6144)