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

ASF GitHub Bot commented on ZOOKEEPER-2316:
-------------------------------------------

GitHub user upangit opened a pull request:

    https://github.com/apache/zookeeper/pull/223

    ZOOKEEPER-2316: comment does not match code logic

    Fixing ZOOKEEPER-2316.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/upangit/zookeeper ZOOKEEPER-2316

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zookeeper/pull/223.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #223
    
----
commit 7705e24a42dcca45291cdf272107d248ee28f356
Author: Umesh Panchaksharaiah <[email protected]>
Date:   2017-04-11T19:05:35Z

    ZOOKEEPER-2316: comment does not match code logic

----


> comment does not match code logic
> ---------------------------------
>
>                 Key: ZOOKEEPER-2316
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2316
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.5.1
>            Reporter: sunhaitao
>            Priority: Trivial
>             Fix For: 3.5.1
>
>
> when i read the code below, the comment is put in an incorrect,place.
> " // in order to be committed, a proposal must be accepted by a quorum "
> should be place on top of :
>    if (!p.hasAllQuorums()) {
>            return false;                 
>         }
> ---------------------------------------------------------------------------------------
>           
> 3.5.1 Leader code  
> // getting a quorum from all necessary configurations
>         if (!p.hasAllQuorums()) {
>            return false;                 
>         }
>         
>         // commit proposals in order
>         if (zxid != lastCommitted+1) {    
>            LOG.warn("Commiting zxid 0x" + Long.toHexString(zxid)
>                     + " from " + followerAddr + " not first!");
>             LOG.warn("First is "
>                     + (lastCommitted+1));
>         }     
>         
>         // in order to be committed, a proposal must be accepted by a quorum  
>             
>         
>         outstandingProposals.remove(zxid);
>         



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to