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

Rakesh R commented on ZOOKEEPER-2186:
-------------------------------------

Thanks [~maalto], [~geek101] for the discussions.

{quote}
Any considerations regarding this patch if there is a need to add more 
information into the InitialMessage in future? 
Now with the change it would fail to accept connections from members having 
different protocol version, and I see it will be quite difficult (or 
impossible) to do rolling upgrades in production systems.
{quote}

To understand more, I hope you referring to the following logic in the trunk & 
3.5 branch. Is there any thing to be addressed in 3.4 branch code?

{code}
            if (protocolVersion != PROTOCOL_VERSION) {
                throw new InitialMessageException(
                        "Got unrecognized protocol version %s", 
protocolVersion);
            }
{code}

{quote}
Markus I have come across the same issue and decided to implement this by 
sending the same notification. I am working on this as part of ZOOKEEPER-901, 
refer some of the discussions about this here ZOOKEEPER-1045.
{quote}
[~geek101] Do you have specific comments about ZOOKEEPER-1045 jira 
implementation?

In ZOOKEEPER-1045 jira I'm thinking of a logic based on PROTOCOL_VERSION. I've 
referred {{3.4 branch}} code base, here I failed to see any validation logic 
against the PROTOCOL_VERSION. Till now old servers are not sending any 
PROTOCOL_VERSION but instead just send their sid. So I think I can safely write 
an upgradation steps from {{3.4.x}} version to {{3.4.y}} version, right? If 
anybody is interested to know my upgradation proposal in ZK-1045 please refer 
https://issues.apache.org/jira/secure/attachment/12780771/ZOOKEEPER-1045-Rolling%20Upgrade%20Design%20Proposal.pdf
 and welcome any comments/questions.

> QuorumCnxManager#receiveConnection may crash with random input
> --------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2186
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2186
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.4.6, 3.5.0
>            Reporter: Raul Gutierrez Segales
>            Assignee: Raul Gutierrez Segales
>             Fix For: 3.4.7, 3.5.1, 3.6.0
>
>         Attachments: ZOOKEEPER-2186-v3.4.patch, ZOOKEEPER-2186.patch, 
> ZOOKEEPER-2186.patch, ZOOKEEPER-2186.patch
>
>
> This will allocate an arbitrarily large byte buffer (and try to read it!):
> {code}
>     public boolean receiveConnection(Socket sock) {
>         Long sid = null;
> ...
>                 sid = din.readLong();
>                 // next comes the #bytes in the remainder of the message      
>                                                                        
>                 int num_remaining_bytes = din.readInt();
>                 byte[] b = new byte[num_remaining_bytes];
>                 // remove the remainder of the message from din               
>                                                                        
>                 int num_read = din.read(b);
> {code}
> This will crash the QuorumCnxManager thread, so the cluster will keep going 
> but future elections might fail to converge (ditto for leaving/joining 
> members). 
> Patch coming up in a bit.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to