From issues-return-2174-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Tue Jan 7 12:51:04 2020 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id E10F718067C for ; Tue, 7 Jan 2020 13:51:03 +0100 (CET) Received: (qmail 49614 invoked by uid 500); 7 Jan 2020 12:51:03 -0000 Mailing-List: contact issues-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 issues@zookeeper.apache.org Received: (qmail 49604 invoked by uid 99); 7 Jan 2020 12:51:03 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jan 2020 12:51:03 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 54206E2C66 for ; Tue, 7 Jan 2020 12:51:01 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id C8CA87804AB for ; Tue, 7 Jan 2020 12:51:00 +0000 (UTC) Date: Tue, 7 Jan 2020 12:51:00 +0000 (UTC) From: "Jordan Zimmerman (Jira)" To: issues@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ZOOKEEPER-2163) Introduce new ZNode type: container MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ZOOKEEPER-2163?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jordan Zimmerman updated ZOOKEEPER-2163: ---------------------------------------- Fix Version/s: (was: 3.6.0) > Introduce new ZNode type: container > ----------------------------------- > > Key: ZOOKEEPER-2163 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2163 > Project: ZooKeeper > Issue Type: New Feature > Components: c client, java client, server > Affects Versions: 3.5.0 > Reporter: Jordan Zimmerman > Assignee: Jordan Zimmerman > Priority: Major > Labels: container_znode_type, pull-request-available > Fix For: 3.5.1 > > Attachments: zookeeper-2163.10.patch, zookeeper-2163.11.patch, zo= okeeper-2163.12.patch, zookeeper-2163.13.patch, zookeeper-2163.14.patch, zo= okeeper-2163.15.patch, zookeeper-2163.3.patch, zookeeper-2163.5.patch, zook= eeper-2163.6.patch, zookeeper-2163.7.patch, zookeeper-2163.8.patch, zookeep= er-2163.9.patch > > Time Spent: 10m > Remaining Estimate: 0h > > BACKGROUND > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > A recurring problem for ZooKeeper users is garbage collection of parent n= odes. Many recipes (e.g. locks, leaders, etc.) call for the creation of a p= arent node under which participants create sequential nodes. When the parti= cipant is done, it deletes its node. In practice, the ZooKeeper tree begins= to fill up with orphaned parent nodes that are no longer needed. The ZooKe= eper APIs don=E2=80=99t provide a way to clean these. Over time, ZooKeeper = can become unstable due to the number of these nodes. > CURRENT SOLUTIONS > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Apache Curator has a workaround solution for this by providing the Reaper= class which runs in the background looking for orphaned parent nodes and d= eleting them. This isn=E2=80=99t ideal and it would be better if ZooKeeper = supported this directly. > PROPOSAL > =3D=3D=3D=3D=3D=3D=3D=3D=3D > ZOOKEEPER-723 and ZOOKEEPER-834 have been proposed to allow EPHEMERAL nod= es to contain child nodes. This is not optimum as EPHEMERALs are tied to a = session and the general use case of parent nodes is for PERSISTENT nodes. T= his proposal adds a new node type, CONTAINER. A CONTAINER node is the same = as a PERSISTENT node with the additional property that when its last child = is deleted, it is deleted (and CONTAINER nodes recursively up the tree are = deleted if empty). > CANONICAL USAGE > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > {code} > while ( true) { // or some reasonable limit > try { > zk.create(path, ...); > break; > } catch ( KeeperException.NoNodeException e ) { > try { > zk.createContainer(containerPath, ...); > } catch ( KeeperException.NodeExistsException ignore) { > } > } > } > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)