Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B39E8105D8 for ; Wed, 25 Sep 2013 03:37:43 +0000 (UTC) Received: (qmail 59145 invoked by uid 500); 25 Sep 2013 03:37:39 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 59102 invoked by uid 500); 25 Sep 2013 03:37:37 -0000 Mailing-List: contact dev-help@curator.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.incubator.apache.org Delivered-To: mailing list dev@curator.incubator.apache.org Received: (qmail 59091 invoked by uid 99); 25 Sep 2013 03:37:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 03:37:35 +0000 X-ASF-Spam-Status: No, hits=-2002.3 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 25 Sep 2013 03:37:32 +0000 Received: (qmail 58919 invoked by uid 99); 25 Sep 2013 03:37:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 03:37:03 +0000 Date: Wed, 25 Sep 2013 03:37:02 +0000 (UTC) From: "Jordan Zimmerman (JIRA)" To: dev@curator.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CURATOR-50) CreateBuilderImpl fails on forPath if connectString features a chroot that does not already exist. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CURATOR-50?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jordan Zimmerman updated CURATOR-50: ------------------------------------ Fix Version/s: TBD > CreateBuilderImpl fails on forPath if connectString features a chroot that does not already exist. > -------------------------------------------------------------------------------------------------- > > Key: CURATOR-50 > URL: https://issues.apache.org/jira/browse/CURATOR-50 > Project: Apache Curator > Issue Type: Bug > Components: Framework > Affects Versions: 2.1.0-incubating > Reporter: Sean-Michael Lewis > Priority: Minor > Fix For: TBD > > > When a CuratorFramework is initialized with a connectString featuring a chroot that does not already exist in the ensemble, CreateBuilderImpl will fail to create new nodes even if createParentsIfNeeded is true. > For example, the following code will result in a org.apache.zookeeper.KeeperException$NoNodeException. > {code} > CuratorFramework client = CuratorFramework.builder().retryPolicy(myPolicy).connectString("myServer1:2181,myServer2:2181/chroot).build(); > client.create().createParentsIfNeeded().forPath("test"); > {code} > This can be worked around by using a namespace in lieu of the chroot or by calling {code}client.create().forPath("/"){code} before attempting to create any other nodes. > While using namespaces is likely the best practice, the framework does initialize with the chroot connectString. There are also reasons why one might want to use both chroot connectStrings as well as namespaces (application environments for the former, application for the latter). > My proposed fix is to alter {code}ZkPaths.mkdirs{code} to not skip "/" when it walks the tree. In cases where no chroot configured or a chroot that already exists, the node will be found and skipped. Otherwise, it will be created. -- 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