AlphaCanisMajoris opened a new pull request, #2152:
URL: https://github.com/apache/zookeeper/pull/2152

   This fix aims to fix a bunch of issues in follower's syncWithLeader(). 
   It is built upon #2111 and inspired by #1848.
   
   #2111 can avoid 
[ZOOKEEPER-4643](https://issues.apache.org/jira/browse/ZOOKEEPER-4643), but it 
cannot fix other issues like 
[ZOOKEEPER-4394](https://issues.apache.org/jira/browse/ZOOKEEPER-4394): the 
NullPointerException problem when the follower receives COMMIT after replying 
NEWLEADER ack in syncWithLeader().
   
   In #1848, when receiving NEWLEADER, the follower only persists and processes 
the packets according to "packetsCommitted".  It guarantees no loss of 
committed txns because the follower syncs the leader's committed history before 
replying NEWLEADER ack. Besides, it avoids 
[ZOOKEEPER-4394](https://issues.apache.org/jira/browse/ZOOKEEPER-4394) by 
keeping the outstanding proposals in "packetsNotCommitted" to avoid 
NullPointerException when receiving COMMIT packet(s) right after replying 
NEWLEADER ack.
   
   Integrated by #2111 and #1848, this fix avoids a group of issues in 
SYNCHRONIZATION, including 
[ZOOKEEPER-4643](https://issues.apache.org/jira/browse/ZOOKEEPER-4643), 
[ZOOKEEPER-4646](https://issues.apache.org/jira/browse/ZOOKEEPER-4646), 
[ZOOKEEPER-4685](https://issues.apache.org/jira/browse/ZOOKEEPER-4685), 
[ZOOKEEPER-4394](https://issues.apache.org/jira/browse/ZOOKEEPER-4394) and the 
problem of flaky tests 
[ZOOKEEPER-3023](https://issues.apache.org/jira/browse/ZOOKEEPER-3023).
   
   More importantly, we have leveraged the TLA+ specifications of ZooKeeper and 
verified the correctness of this fix.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to