You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2019/09/12 07:19:43 UTC

[GitHub] [zookeeper] insumity commented on a change in pull request #1081: ZOOKEEPER-3537: Leader election - Use of out of election messages

insumity commented on a change in pull request #1081: ZOOKEEPER-3537: Leader election - Use of out of election messages
URL: https://github.com/apache/zookeeper/pull/1081#discussion_r323589500
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java
 ##########
 @@ -1032,9 +1032,9 @@ public Vote lookForLeader() throws InterruptedException {
                          * together.
                          */
                         if (n.electionEpoch == logicalclock.get()) {
-                            recvset.put(n.sid, new Vote(n.leader, n.zxid, n.electionEpoch, n.peerEpoch));
+                            recvset.put(n.sid, new Vote(n.leader, n.zxid, n.electionEpoch, n.peerEpoch, n.state));
                             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)) {
+                            if (voteSet.hasAllQuorums() && checkLeader(recvset, n.leader, n.electionEpoch)) {
 
 Review comment:
   Thanks for your input @hanm. I introduced some comments at the declaration point of both `recvset` and `outofelection`, as well as, at the point where votes are being added in `outofelection`. What do you think?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services