Return-Path: X-Original-To: apmail-zookeeper-dev-archive@www.apache.org Delivered-To: apmail-zookeeper-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6747970D2 for ; Sun, 7 Aug 2011 18:24:50 +0000 (UTC) Received: (qmail 83861 invoked by uid 500); 7 Aug 2011 18:24:50 -0000 Delivered-To: apmail-zookeeper-dev-archive@zookeeper.apache.org Received: (qmail 83763 invoked by uid 500); 7 Aug 2011 18:24:49 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 83755 invoked by uid 99); 7 Aug 2011 18:24:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Aug 2011 18:24:48 +0000 X-ASF-Spam-Status: No, hits=-2000.8 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Aug 2011 18:24:47 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 1826AB054D for ; Sun, 7 Aug 2011 18:24:27 +0000 (UTC) Date: Sun, 7 Aug 2011 18:24:27 +0000 (UTC) From: "Vishal Kher (JIRA)" To: dev@zookeeper.apache.org Message-ID: <744635218.14916.1312741467095.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1084958107.6331.1312411047199.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (ZOOKEEPER-1144) ZooKeeperServer not starting on leader due to a race condition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ZOOKEEPER-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080615#comment-13080615 ] Vishal Kher commented on ZOOKEEPER-1144: ---------------------------------------- Fix looks to be very simple. Running tests now, will submit patch if tests succeed. > ZooKeeperServer not starting on leader due to a race condition > -------------------------------------------------------------- > > Key: ZOOKEEPER-1144 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1144 > Project: ZooKeeper > Issue Type: Bug > Affects Versions: 3.4.0 > Reporter: Vishal Kher > Priority: Blocker > Fix For: 3.4.0 > > > I have found one problem that is causing QuorumPeerMainTest:testQuorum to fail. This test uses 2 ZK servers. > The test is failing because leader is not starting ZooKeeperServer after leader election. so everything halts. > With the new changes, the server is now started in Leader.processAck() which is called from LeaderHandler. processAck() starts ZooKeeperServer if majority have acked NEWLEADER. The leader puts its ack in the the ackSet in Leader.lead(). Since processAck() is called from LearnerHandler it can happen that the learner's ack is processed before the leader is able to put its ack in the ackSet. When LearnerHandler invokes processAck(), the ackSet for newLeaderProposal will not have quorum (in this case 2). As a result, the ZooKeeperServer is never started on the Leader. > The leader needs to ensure that its ack is put in ackSet before starting LearnerCnxAcceptor or invoke processAck() itself after adding to ackSet. I haven't had time to go through the ZAB2 changes so I am not too familiar with the code. Can Ben/Flavio fix this? -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira