zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanm <...@git.apache.org>
Subject [GitHub] zookeeper pull request #703: [ZOOKEEPER-1818] Correctly handle potential inc...
Date Thu, 29 Nov 2018 06:45:29 GMT
Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/703#discussion_r237367684
  
    --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
---
    @@ -1042,14 +1035,13 @@ else if (validVoter(n.sid) && validVoter(n.leader)) {
                              */
                             if(n.electionEpoch == logicalclock.get()){
                                 recvset.put(n.sid, new Vote(n.leader, n.zxid, n.electionEpoch,
n.peerEpoch));
    -                            voteSet = getVoteTracker(
    -                                    recvset, new Vote(n.leader, n.zxid,
    -                                    n.electionEpoch, n.peerEpoch, n.state));
    -                            if(voteSet.hasAllQuorums()
    -                                            && checkLeader(outofelection, n.leader,
n.electionEpoch)) {
    +                            voteSet = getVoteTracker(recvset, new Vote(n.version, 
    +                                      n.leader, n.zxid, n.electionEpoch, n.peerEpoch,
n.state));
    +                            if (voteSet.hasAllQuorums() && 
    +                                    checkLeader(outofelection, n.leader, n.electionEpoch))
{
                                     setPeerState(n.leader, voteSet);
    -
    -                                Vote endVote = new Vote(n.leader, n.zxid, n.peerEpoch);
    +                                Vote endVote = new Vote(n.leader, 
    +                                        n.zxid, n.electionEpoch, n.peerEpoch);
    --- End diff --
    
    nit: indentation


---

Mime
View raw message