jonmv commented on code in PR #1925:
URL: https://github.com/apache/zookeeper/pull/1925#discussion_r985991467


##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java:
##########
@@ -760,13 +760,21 @@ protected void syncWithLeader(long newLeaderZxid) throws 
Exception {
                     zk.startupWithoutServing();
                     if (zk instanceof FollowerZooKeeperServer) {
                         FollowerZooKeeperServer fzk = 
(FollowerZooKeeperServer) zk;
+                        fzk.syncProcessor.setDelayForwarding(true);
                         for (PacketInFlight p : packetsNotLogged) {
                             fzk.logRequest(p.hdr, p.rec, p.digest);
                         }
                         packetsNotLogged.clear();
+                        fzk.syncProcessor.syncFlush();
                     }
 
                     writePacket(new QuorumPacket(Leader.ACK, newLeaderZxid, 
null, null), true);
+
+                    if (zk instanceof FollowerZooKeeperServer) {
+                        FollowerZooKeeperServer fzk = 
(FollowerZooKeeperServer) zk;
+                        fzk.syncProcessor.setDelayForwarding(false);
+                        fzk.syncProcessor.syncFlush();

Review Comment:
   To ensure consistent ordering of the UPTODATE ACK, vs ACKs from PROPOSALs. 
The real leader doesn't care, but unit tests may. 



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