[
https://issues.apache.org/jira/browse/ZOOKEEPER-2316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15981852#comment-15981852
]
ASF GitHub Bot commented on ZOOKEEPER-2316:
-------------------------------------------
Github user hanm commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/223#discussion_r113050394
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Leader.java ---
@@ -724,6 +724,8 @@ synchronized public boolean tryToCommit(Proposal p,
long zxid, SocketAddress fol
// concurrent reconfigs are allowed, this can happen.
if (outstandingProposals.containsKey(zxid - 1)) return false;
+ // in order to be committed, a proposal must be accepted by a quorum
+ //
--- End diff --
This blank line can be removed.
> 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)