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

Germán Blanco commented on ZOOKEEPER-1817:
------------------------------------------

This works very well and it looks excellent overall.
However, I am starting to have doubts about this comparison in Vote.java:
{noformat}
+            if (version == other.version) {
+                return (id == other.id
+                        && peerEpoch == other.peerEpoch);
+            } else {
+                return id == other.id;
+            }
{noformat}
We know 3.4.5 peerEpoch has a different value than in the rest. But the 
difference is there only for 3.4.5. I think this comparison should be a bit 
different, and more in line with the use of backwards compatibility vote in 
FastLeaderElection.java ...
{noformat}
                                    ToSend notmsg;
                                    if(n.version > 0x0) {
                                        notmsg = new ToSend(
{noformat}
that would be "if one of the versions is 0x0 and the other is not, then don't 
use peerEpoch. Otherwise use it" ...
{noformat}
+            if ((version > 0x0) ^ (other.version > 0x0)) {
+                return id == other.id;
+            } else {
+                return (id == other.id
+                        && peerEpoch == other.peerEpoch);
+            }
{noformat}

> Fix don't care for b3.4
> -----------------------
>
>                 Key: ZOOKEEPER-1817
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1817
>             Project: ZooKeeper
>          Issue Type: Sub-task
>            Reporter: Flavio Junqueira
>            Assignee: Flavio Junqueira
>            Priority: Blocker
>             Fix For: 3.4.6
>
>         Attachments: ZOOKEEPER-1817.patch, ZOOKEEPER-1817.patch, 
> ZOOKEEPER-1817.patch, ZOOKEEPER-1817.patch, ZOOKEEPER-1817.patch, 
> ZOOKEEPER-1817.patch, ZOOKEEPER-1817.patch, ZOOKEEPER-1817.patch, 
> ZOOKEEPER-1817.patch, logs.tar.gz, logs2.tar.gz
>
>
> See umbrella jira.



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

Reply via email to