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


##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java:
##########
@@ -55,6 +56,55 @@ public class SyncRequestProcessor extends 
ZooKeeperCriticalThread implements Req
 
     private static final Request REQUEST_OF_DEATH = Request.requestOfDeath;
 
+    private static class FlushRequest extends Request {
+        private final CountDownLatch latch = new CountDownLatch(1);
+        public FlushRequest() {
+            super(null, 0, 0, 0, null, null);
+        }
+    }
+
+    private static final Request turnForwardingDelayOn = new Request(null, 0, 
0, 0, null, null);
+    private static final Request turnForwardingDelayOff = new Request(null, 0, 
0, 0, null, null);
+
+    private static class DelayingProcessor implements RequestProcessor, 
Flushable {

Review Comment:
   does this need to be a new processor? could we inline this into the 
SyncRequestProcessor?



##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java:
##########
@@ -643,33 +644,36 @@ protected void syncWithLeader(long newLeaderZxid) throws 
Exception {
                         self.setLastSeenQuorumVerifier(qv, true);
                     }
 
+                    packetsNotLogged.add(pif);
                     packetsNotCommitted.add(pif);
                     break;
                 case Leader.COMMIT:
                 case Leader.COMMITANDACTIVATE:
                     pif = packetsNotCommitted.peekFirst();
-                    if (pif.hdr.getZxid() == qp.getZxid() && qp.getType() == 
Leader.COMMITANDACTIVATE) {
-                        QuorumVerifier qv = self.configFromString(new 
String(((SetDataTxn) pif.rec).getData(), UTF_8));
-                        boolean majorChange = self.processReconfig(
-                            qv,
-                            ByteBuffer.wrap(qp.getData()).getLong(), 
qp.getZxid(),
-                            true);
-                        if (majorChange) {
-                            throw new Exception("changes proposed in 
reconfig");
+                    if (pif.hdr.getZxid() != qp.getZxid()) {
+                        LOG.warn(
+                            "Committing 0x{}, but next proposal is 0x{}",

Review Comment:
   i can't remember if this got fixed, but do we still have a gratuitous print 
of this warning when we first sync? (if so, it might be nice to fix since we 
are touching it.)



##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java:
##########
@@ -555,6 +555,7 @@ protected void syncWithLeader(long newLeaderZxid) throws 
Exception {
         boolean syncSnapshot = false;
         readPacket(qp);
         Deque<Long> packetsCommitted = new ArrayDeque<>();
+        Deque<PacketInFlight> packetsNotLogged = new ArrayDeque<>();

Review Comment:
   since you are adding a list that is quite parallel to packetsNotCommitted 
can you put comments to how the two differ? (and perhaps why both are needed?)



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