From dev-return-74759-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Wed Oct 17 07:35:06 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 D9F7A180674 for ; Wed, 17 Oct 2018 07:35:05 +0200 (CEST) Received: (qmail 86937 invoked by uid 500); 17 Oct 2018 05:35:04 -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 86916 invoked by uid 99); 17 Oct 2018 05:35:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2018 05:35:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A0B50C1E02 for ; Wed, 17 Oct 2018 05:35:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id xWYrOjOunSCO for ; Wed, 17 Oct 2018 05:35:02 +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 D86645F536 for ; Wed, 17 Oct 2018 05:35: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 D8DF0E25D5 for ; Wed, 17 Oct 2018 05:35: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 5365124E3D for ; Wed, 17 Oct 2018 05:35:00 +0000 (UTC) Date: Wed, 17 Oct 2018 05:35:00 +0000 (UTC) From: "Mohammad Arshad (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=16652982#comment-16652982 ] Mohammad Arshad commented on ZOOKEEPER-2925: -------------------------------------------- [~dineshappavoo], no objection at all, please go ahead and raise the pull request > 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)