zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] hanm commented on a change in pull request #1047: [ZOOKEEPER-3500] Improving the ZAB UPTODATE semantic to only issue it to learner when there is limited lagging
Date Wed, 14 Aug 2019 05:42:24 GMT
hanm commented on a change in pull request #1047: [ZOOKEEPER-3500] Improving the ZAB UPTODATE
semantic to only issue it to learner when there is limited lagging
URL: https://github.com/apache/zookeeper/pull/1047#discussion_r313710938
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LearnerHandler.java
 ##########
 @@ -615,21 +632,30 @@ public void run() {
             syncThrottler.endSync();
             syncThrottler = null;
 
-            // now that the ack has been processed expect the syncLimit
-            sock.setSoTimeout(learnerMaster.syncTimeout());
-
             /*
              * Wait until learnerMaster starts up
              */
             learnerMaster.waitForStartup();
 
+            int queueSize = queuedPackets.size();
+            while (upToDatePacketsLimit > 0 && queueSize > upToDatePacketsLimit)
{
+                LOG.info("Waiting for learner queue to be drained before " +
+                        "sending UPTODATE to {}, current queue size: {}",
+                        sid, queueSize);
+                Thread.sleep(100);
 
 Review comment:
   I am wondering why we need to wait for the learner to drain its queued in flight commits
- we could just, as usual, send a `UPTODATE` and then on learner side make sure zookeeper
server does not start serving traffic until the queued commits are applied to data tree (which,
seems to be what this patch is doing). Do we need wait here?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message