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 F41D810A1E for ; Thu, 5 Sep 2013 21:03:52 +0000 (UTC) Received: (qmail 36663 invoked by uid 500); 5 Sep 2013 21:03:52 -0000 Delivered-To: apmail-zookeeper-dev-archive@zookeeper.apache.org Received: (qmail 36537 invoked by uid 500); 5 Sep 2013 21:03:52 -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 36516 invoked by uid 99); 5 Sep 2013 21:03:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2013 21:03:52 +0000 Date: Thu, 5 Sep 2013 21:03:52 +0000 (UTC) From: "Flavio Junqueira (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ZOOKEEPER-1448) Node+Quota creation in transaction log can crash leader startup 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-1448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Flavio Junqueira updated ZOOKEEPER-1448: ---------------------------------------- Attachment: ZOOKEEPER-1448-trunk.patch The latest patch didn't apply cleanly, so I generate a new one. > Node+Quota creation in transaction log can crash leader startup > --------------------------------------------------------------- > > Key: ZOOKEEPER-1448 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1448 > Project: ZooKeeper > Issue Type: Bug > Components: server > Affects Versions: 3.3.5 > Reporter: Botond Hejj > Assignee: Flavio Junqueira > Priority: Critical > Fix For: 3.5.0, 3.4.6 > > Attachments: ZOOKEEPER-1448_branch3.3.patch, ZOOKEEPER-1448.patch, ZOOKEEPER-1448.patch, ZOOKEEPER-1448.patch, ZOOKEEPER-1448.patch, ZOOKEEPER-1448.patch, ZOOKEEPER-1448-trunk.patch > > > Hi, > I've found a bug in zookeeper related to quota creation which can shutdown zookeeper leader on startup. > Steps to reproduce: > 1. create /quota_bug > 2. setquota -n 10000 /quota_bug > 3. stop the whole ensemble (the previous operations should be in the transaction log) > 4. start all the servers > 5. the elected leader will shutdown with an exception (Missing stat node for count /zookeeper/quota/quota_bug/zookeeper_ > stats) > I've debugged a bit what happening and I found the following problem: > On startup each server loads the last snapshot and replays the last transaction log. While doing this it fills up the pTrie variable of the DataTree with the path of the nodes which have quota. > After the leader is elected the leader servers loads the snapshot and last transaction log but it doesn't clean up the pTrie variable. This means it still contains the "/quota_bug" path. Now when the "create /quota_bug" is processed from the transaction log the DataTree already thinks that the quota nodes ("/zookeeper/quota/quota_bug/zookeeper_limits" and "/zookeeper/quota/quota_bug/zookeeper_stats") are created but those node creation actually comes later in the transaction log. This leads to the missing stat node exception. > I think clearing the pTrie should solve this problem. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira