Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6EA6418229 for ; Wed, 29 Jul 2015 16:24:04 +0000 (UTC) Received: (qmail 61515 invoked by uid 500); 29 Jul 2015 16:23:05 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 61467 invoked by uid 500); 29 Jul 2015 16:23:05 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 61454 invoked by uid 99); 29 Jul 2015 16:23:05 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2015 16:23:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 96CD71A8B2C for ; Wed, 29 Jul 2015 16:23:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.001 X-Spam-Level: **** X-Spam-Status: No, score=4.001 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id EN4SZnDFXQqk for ; Wed, 29 Jul 2015 16:22:54 +0000 (UTC) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 9CDF4203A3 for ; Wed, 29 Jul 2015 16:22:53 +0000 (UTC) Received: by pdjr16 with SMTP id r16so8535391pdj.3 for ; Wed, 29 Jul 2015 09:22:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:message-id:in-reply-to:references :subject:mime-version:content-type; bh=fDk9V+n7Df6eQrSsL7dKf0sjRM6vtNXCby5ILJtAq8A=; b=Yyx2vIydEj2iI/dNNL0pQYkmwCy2HVGIXhfR9P09DA39Bx/qD6LQSf+aDxOSrZtjUI ct577F/wNK6oJ903/ekCl1OMMlD4P0FH/Kn45GatXw7N080dhXr1HgiiBsT5TP2C7FOP nhYNSEKTDujbtn0xeMlT2EO/5RNvWEkMp62JoaDBdZrNppDcKb6GYSdv/tLYkYVLmOoG a1b8iZpnA3/vr3D8+ERNuuvGg7MZIkwqYYDBIrbhqhwwbVcQQoi2UBmT7BSmQy2w6DBR /p6GyYZHT1LP9M4i93RcNvy9+HqeB7nFSC4shqlnxQz27lOF2acYARlrLD/xHgVekcyw DXbQ== X-Gm-Message-State: ALoCoQm1oVSZ05C1OOtrTkLLfDvR0eH9axJjS4bwQksfsCa0KrDKpoQAEJI7Quvp+BKBNxuFVXid X-Received: by 10.70.63.37 with SMTP id d5mr96184791pds.162.1438186920985; Wed, 29 Jul 2015 09:22:00 -0700 (PDT) Received: from Jordans-MacBook-Pro.local ([190.140.97.103]) by smtp.gmail.com with ESMTPSA id j4sm41611501pdo.62.2015.07.29.09.21.57 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jul 2015 09:21:59 -0700 (PDT) Date: Wed, 29 Jul 2015 11:21:55 -0500 From: Jordan Zimmerman To: user@zookeeper.apache.org, Prabhjot Bharaj , dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: Re: Corner case in Ephemeral-sequential node creation X-Mailer: Airmail (303) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="55b8fda3_4701ad30_15d" --55b8fda3_4701ad30_15d Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Here=E2=80=99s the comment from Curator that explains it and how Curator = works around it: =22It turns out there is an edge case that exists when creating sequentia= l-ephemeral nodes. The creation can succeed on the server, but the server= can crash before the created node name is returned to the client. Howeve= r, the ZK session is still valid so the ephemeral node is not deleted. Th= us, there is no way for the client to determine what node was created for= them. Even without sequential-ephemeral, however, the create can succeed on the= sever but the client (for various reasons) will not know it. Putting the create builder into protection mode works around this. The na= me of the node that is created is prefixed with a GUID. If node creation = fails the normal retry mechanism will occur. On the retry, the parent pat= h is first searched for a node that has the GUID in it. If that node is f= ound, it is assumed to be the lost node that was successfully created on = the first try and is returned to the caller.=22 On July 29, 2015 at 11:19:37 AM, Prabhjot Bharaj (prabhbharaj=40gmail.com= ) wrote: Hello folks, =20 I was going through this blog : =20 http://blog.cloudera.com/blog/2013/05/zookeeper-made-simpler/ (it is 2+ =20 years old) =20 In the second paragraph of the 'Recipes' section, there is a sentence:- =20 *New users of ZooKeeper will not know that there is an edge case in =20 ephemeral-sequential node creation that requires you to put a special =20 =E2=80=9Cmarker=E2=80=9D in the node=E2=80=99s name so that you can searc= h for the created node if =20 an I/O failure occurs. This is but one of many edge cases that are not ye= t =20 well documented.* =20 I would request you to explain this corner case here, as I haven't =20 considered this corner case anytime in my code. =20 Regards, =20 prabcs =20 --55b8fda3_4701ad30_15d--