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 A9F24183B2 for ; Wed, 15 Jul 2015 18:20:35 +0000 (UTC) Received: (qmail 8224 invoked by uid 500); 15 Jul 2015 18:20:35 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 8180 invoked by uid 500); 15 Jul 2015 18:20:34 -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 8169 invoked by uid 99); 15 Jul 2015 18:20:34 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2015 18:20:34 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3F0BFC0098 for ; Wed, 15 Jul 2015 18:20:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 5.294 X-Spam-Level: ***** X-Spam-Status: No, score=5.294 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id SPtCGmjwJUzy for ; Wed, 15 Jul 2015 18:20:26 +0000 (UTC) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id E1ACB22F0B for ; Wed, 15 Jul 2015 18:20:25 +0000 (UTC) Received: by pactm7 with SMTP id tm7so28325771pac.2 for ; Wed, 15 Jul 2015 11:19:34 -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=oTF07KPPR2q5zEJQsm2MH/SBnmIuvuZ77f0ZT+x6coE=; b=GwgdSYOOpcgRyLTf0vRTd7WRFiHnileL4rgW4uxI5KkTji2aHN9Va6vf7DkXcGAycW Js4HbaYTBXlR4k73zBwhsGXl7AcbmGswbRibP1OqXT5C8fJWXzXY2iJVE1MKVOWZ0bpP tkHO/7VV6pM04hLZ+2x9hl47bXLaz5Smk2BftIhPnbYgny9iCsIWfo9QbV/BSjhgnSbb Jts1/TmbjdXHXxdPpllMs05c+MvzNSPktZonYEfW1gZjlE3V1IhIpbv69cxrlb4M3MqO mwyHC36hgA/Rr2oCCmUhSv9khi18WF9BZPkOUDfi0EdqKdJTdWU1DsINwc/EvgPUelSR oKfw== X-Gm-Message-State: ALoCoQl1gZseK8mPkA7W46GNU9HjxmBWpgxeQbbXlLJFYKTB1siK6ffxVXqGl91i4WydVl9H5vZf X-Received: by 10.66.66.166 with SMTP id g6mr10521885pat.114.1436984374264; Wed, 15 Jul 2015 11:19:34 -0700 (PDT) Received: from Jordans-MacBook-Pro.local ([190.140.97.103]) by smtp.gmail.com with ESMTPSA id ys3sm5337540pbb.96.2015.07.15.11.19.32 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Jul 2015 11:19:33 -0700 (PDT) Date: Wed, 15 Jul 2015 13:19:30 -0500 From: Jordan Zimmerman To: zookeeper-user@hadoop.apache.org, Vikas Mehta , user@zookeeper.apache.org Message-ID: In-Reply-To: <1436984221201-7581279.post@n2.nabble.com> References: <1436982861611-7581277.post@n2.nabble.com> <1436984221201-7581279.post@n2.nabble.com> Subject: Re: locking/leader election and dealing with session loss X-Mailer: Airmail (303) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="55a6a432_7c111597_15a" --55a6a432_7c111597_15a Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Once client A loses connection it must assume that it no longer has the l= ock (you could try to time the session but I think that=E2=80=99s a bad i= dea). Once you reconnect, you will know if your session is still active o= r not. When done correctly, there=E2=80=99s no chance that both A and B w= ill think they own the lock at the same time. -Jordan On July 15, 2015 at 1:17:10 PM, Vikas Mehta (vikasmehta=40gmail.com) wrot= e: Thanks for the quick response Camille. If client A owns the lock, gets =20 disconnected due to network partition, it will not see the SESSION=5FEXPI= RED =20 event until it is too late, i.e. client B has acquired the lock and done = the =20 damage. Problem here is that client cannot distinguish network partition = =20 from zookeeper ensemble in leader election state. =20 -- =20 View this message in context: http://zookeeper-user.578899.n2.nabble.com/= locking-leader-election-and-dealing-with-session-loss-tp7581277p7581279.h= tml =20 Sent from the zookeeper-user mailing list archive at Nabble.com. =20 --55a6a432_7c111597_15a--