[ 
https://issues.apache.org/jira/browse/CURATOR-274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14969931#comment-14969931
 ] 

ASF GitHub Bot commented on CURATOR-274:
----------------------------------------

Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/115#discussion_r42808623
  
    --- Diff: 
curator-framework/src/main/java/org/apache/curator/framework/EnsureContainers.java
 ---
    @@ -0,0 +1,65 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.curator.framework;
    +
    +import org.apache.curator.utils.EnsurePath;
    --- End diff --
    
    Unused import?


> version 2.9.0 incorrectly calls mkdirs to create container nodes, when 
> running against zk 3.4.6
> -----------------------------------------------------------------------------------------------
>
>                 Key: CURATOR-274
>                 URL: https://issues.apache.org/jira/browse/CURATOR-274
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>    Affects Versions: 2.9.0
>            Reporter: Jason Rosenberg
>            Assignee: Jordan Zimmerman
>            Priority: Blocker
>             Fix For: 2.9.1
>
>
> I recently attempted to upgrade to use curator 2.9.0 (we had been using 
> 2.7.0). We are using zookeeper 3.4.6.
> We use the PathChildrenCache, to watch nodes, that can be deleted.  Our tests 
> fail with 2.9.0 because after we delete a node, the PathChildrenCache 
> immediately re-creates the parent directories for the deleted node.
> In the logs, we see:
> {code}
> 2015-10-21 04:51:39,642  WARN [path-cache /parent1/parent2/parent3-0] 
> utils.ZKPaths - The version of ZooKeeper being used doesn't support Container 
> nodes. CreateMode.PERSISTENT will be used instead.
> {code}
> Unfortunately, this results in persistent nodes being created.  But since 
> container mode is not available in 3.4.6, it should not have attempted to 
> create the container nodes in the first place.
> The behavior starts with PathChildrenCache.refresh(), with call sequence 
> below, which happens after the node is deleted:
> {code}
> PathChildrenCache.refresh(); -> 
> PathChildrenCache.ensurePath(); ->
> PathChildrenCache.client.createContainers(path); ->
> CuratorFrameworkImpl.checkExists().creatingParentContainersIfNeeded().forPath(ZKPaths.makePath(path,
>  "foo")); ->
> ...
> ExistsBulderImpl.ZKPaths.mkdirs(client.getZooKeeper(), parent, true, 
> client.getAclProvider(), true);
> {code}
> It seems to be rather unexpected behavior to default to creating persistent 
> nodes if container nodes aren't available.  Instead, if container nodes are 
> not available, the behavior should be to do nothing (this is the behavior 
> we've been living with 'til now).
> This is a Blocker, because it prevents upgrading, for anyone who might delete 
> a node watched by a PathChildrenCache.
> I did not look to see if a similar issue might exist in the other cache 
> recipes, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to