From dev-return-74758-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Wed Oct 17 07:15:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 256A718061A for ; Wed, 17 Oct 2018 07:15:03 +0200 (CEST) Received: (qmail 56980 invoked by uid 500); 17 Oct 2018 05:15:02 -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 56968 invoked by uid 99); 17 Oct 2018 05:15:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2018 05:15:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 4993DC5E0D for ; Wed, 17 Oct 2018 05:15:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Rc4fLeFSgC-J for ; Wed, 17 Oct 2018 05:15:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 266485F35B for ; Wed, 17 Oct 2018 05:15:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5FA87E0D27 for ; Wed, 17 Oct 2018 05:15:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 24D0724DEB for ; Wed, 17 Oct 2018 05:15:00 +0000 (UTC) Date: Wed, 17 Oct 2018 05:15:00 +0000 (UTC) From: "Andor Molnar (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-2925) ZooKeeper server fails to start on first-startup due to race to create dataDir & snapDir 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-2925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16652966#comment-16652966 ] Andor Molnar commented on ZOOKEEPER-2925: ----------------------------------------- Hi [~dineshappavoo] Welcome to the community! Feel free to pick this up and investigate. I haven't faced this issue before, but if you can reproduce it, this will be a good one to work on. Thanks for the contribution and happy coding! > ZooKeeper server fails to start on first-startup due to race to create dataDir & snapDir > ---------------------------------------------------------------------------------------- > > Key: ZOOKEEPER-2925 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2925 > Project: ZooKeeper > Issue Type: Bug > Components: other > Affects Versions: 3.4.6 > Reporter: Robert P. Thille > Priority: Major > Labels: easyfix, newbie, patch > Fix For: 3.4.10 > > Attachments: ZOOKEEPER-2925.patch > > > Due to two threads trying to create the dataDir and snapDir, and the java.io.File.mkdirs() call returning false both for errors and for the directory already existing, sometimes ZooKeeper will fail to start with the following stack trace: > {noformat} > 2017-10-25 22:30:40,069 [myid:] - INFO [main:ZooKeeperServerMain@95] - Starting server > 2017-10-25 22:30:40,075 [myid:] - INFO [main:Environment@100] - Server environment:zookeeper.version=3.4.6-mdavis8efb625--1, built on 10/25/2017 01:12 GMT > [ More 'Server environment:blah blah blah' messages trimmed] > 2017-10-25 22:30:40,077 [myid:] - INFO [main:Environment@100] - Server environment:user.dir=/ > 2017-10-25 22:30:40,081 [myid:] - ERROR [main:ZooKeeperServerMain@63] - Unexpected exception, exiting abnormally > java.io.IOException: Unable to create data directory /bp2/data/version-2 > at org.apache.zookeeper.server.persistence.FileTxnSnapLog.(FileTxnSnapLog.java:85) > at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:104) > at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:86) > at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:52) > at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116) > at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78) > 2017-10-25 22:30:40,085 [myid:] - INFO [PurgeTask:DatadirCleanupManager$PurgeTask@144] - Purge task completed. > {noformat} > this is caused by the QuorumPeerMain thread and the PurgeTask thread both competing to create the directories. -- This message was sent by Atlassian JIRA (v7.6.3#76005)