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 01ACA18197 for ; Tue, 3 Nov 2015 18:30:16 +0000 (UTC) Received: (qmail 4912 invoked by uid 500); 3 Nov 2015 18:30:15 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 4863 invoked by uid 500); 3 Nov 2015 18:30:15 -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 4851 invoked by uid 500); 3 Nov 2015 18:30:15 -0000 Delivered-To: apmail-hadoop-zookeeper-user@hadoop.apache.org Received: (qmail 4848 invoked by uid 99); 3 Nov 2015 18:30:15 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2015 18:30:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id AAE02180A60 for ; Tue, 3 Nov 2015 18:30:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.102 X-Spam-Level: X-Spam-Status: No, score=-0.102 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id eQHSP7Mi6RQZ for ; Tue, 3 Nov 2015 18:30:14 +0000 (UTC) Received: from mail-qg0-f50.google.com (mail-qg0-f50.google.com [209.85.192.50]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id F0F64439D8 for ; Tue, 3 Nov 2015 18:30:13 +0000 (UTC) Received: by qgeo38 with SMTP id o38so20859354qge.0 for ; Tue, 03 Nov 2015 10:30:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; bh=hndfpW2P34TKE5fvWLHyc8vogL3bdTQ4FY48EbO4Zsw=; b=nWbfM2srdMYgautb1lPZMk/HFr8nyGXS0QVCElkXMJb2S1embXHzQ+EtcQxx6LTk/c vhF6UeHat5UbZO1bc/pmaeIOYHZ6SJ5m9/qb2cV7Ci8kmzs11+xRxcyFrtcEsZmVefVP h0Yj7GscjqAiHayPr/ZhxFhsQOuFF3R+MolNb9N3BNae5rXNbROCJgdlldo2+aLuNVx3 E463v8jec/ehKHtBwjYnR5kwmghDPgRIMhs5jMDEc5btdqgVq0pY2tVvvwXAFdSqAQwg wCQ/Y/KoOR8PsuxSgCAhQYCMhFF/zy4S+UkSYmods15rkBFL6tSWvzc4vHX00xEe4mv+ CyHA== X-Received: by 10.140.161.139 with SMTP id h133mr41648947qhh.57.1446575413605; Tue, 03 Nov 2015 10:30:13 -0800 (PST) Received: from [192.168.52.224] ([138.20.184.129]) by smtp.gmail.com with ESMTPSA id 44sm10162389qgh.11.2015.11.03.10.30.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Nov 2015 10:30:13 -0800 (PST) From: kamel.zaarouri@gmail.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: Why can't an ephemeral non sequential node creation be used as a lock? Message-Id: <732D3AF1-0E42-452B-AABE-6FEA9F63B2F0@gmail.com> Date: Tue, 3 Nov 2015 13:30:12 -0500 To: zookeeper-user@hadoop.apache.org X-Mailer: iPhone Mail (13B143) Hi, I have 3 zookeeper clients that will receive a request within seconds apart.= Only 1 client is allowed to handle this request. I was thinking that each client will try to create the same ephemeral node n= on sequential node. The client that can is by definition the leader and is t= he one that will handle the request. But then I saw that there's a recipe for creating a lock.=20 Would the above strategy work or should I use the recipe? Can someone tell m= e what could go wrong with what I described? Thanks=20=