[ https://issues.apache.org/jira/browse/ZOOKEEPER-1343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13175410#comment-13175410 ]
Flavio Junqueira commented on ZOOKEEPER-1343: --------------------------------------------- The problem described occurs when the last accepted epoch e of a peer p is one more than the last accepted epoch e' of another peer p' (e' = e + 1). If getEpochToPropose is called for p before being called for p', then the value of epoch will be e' instead of e' + 1. I can try to take a cut at a test. I have already checked that the modification doesn't break anything. > getEpochToPropose should check if lastAcceptedEpoch is greater or equal than > epoch > ---------------------------------------------------------------------------------- > > Key: ZOOKEEPER-1343 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1343 > Project: ZooKeeper > Issue Type: Bug > Reporter: Flavio Junqueira > Assignee: Flavio Junqueira > > The following block in Leader.getEpochToPropose: > {noformat} > if (lastAcceptedEpoch > epoch) { > epoch = lastAcceptedEpoch+1; > } > {noformat} > needs to be fixed, since it doesn't increment the epoch variable in the case > epoch != -1 (initial value) and lastAcceptedEpoch is equal. The fix trivial > and corresponds to changing > with >=. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira