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 7284410DF5 for ; Tue, 26 Nov 2013 10:10:13 +0000 (UTC) Received: (qmail 82581 invoked by uid 500); 26 Nov 2013 10:10:11 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 82407 invoked by uid 500); 26 Nov 2013 10:10:11 -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 82371 invoked by uid 99); 26 Nov 2013 10:10:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Nov 2013 10:10:07 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=FORGED_YAHOO_RCVD,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [212.82.97.142] (HELO nm37-vm1.bullet.mail.ir2.yahoo.com) (212.82.97.142) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 26 Nov 2013 10:10:00 +0000 Received: from [212.82.98.125] by nm37.bullet.mail.ir2.yahoo.com with NNFMP; 26 Nov 2013 10:09:39 -0000 Received: from [46.228.39.107] by tm18.bullet.mail.ir2.yahoo.com with NNFMP; 26 Nov 2013 10:09:39 -0000 Received: from [127.0.0.1] by smtp144.mail.ir2.yahoo.com with NNFMP; 26 Nov 2013 10:09:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1385460579; bh=w+lE/2hkF1zQVcvwkUn6TbTG9/qy00x5VLOBG8QtmyA=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=qJLj+FiEP/u6NZCjzlBhPs7JwTk2yCaxM3teM4GeeX5QvmKgUlPOFCmHrxykULkLLJ0tcgilitJCqGs+8CT+esa0kam978bM60xW/IDYZs59YiWb0LBxtub2cOBtGMjDHEo5e6mXxl3u0Xcsa8tyBGsNVQ9kRjfaJTMr7M6DnYw= X-Yahoo-Newman-Id: 411578.62862.bm@smtp144.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 2fyjvmsVM1lsgsIJufNhH8wSsghTT8rqqIB6Alawf8kOfy4 vmqQ4kS2CBvGJe8v0sIn_9R9CcYGmXdKqAmvAH4KsChapD7fUAHT3.beGCsy __wT_fTKDPWQfTGfazC6fiyGjyhTQ7F8Pu5Gpsab7.qAS8y0rXtKxNTNzLrk xl9Q3ZIogvijUMwMob0szBiSxzsHGoWJV8nfE05R2R1zdjnwQ.rkMd.BPIN9 jQ7Z4iksZjU_Eu2uRYMuTXri5qEzE1ATVWe9owlIRq0q9P2kYfq4Em1HIEew GXfg8ktwroRoFIYUaBE629GrcJArQ.GuToAKptchW5JxFbSGNwlXDroVpLVB GA.yPR1yVkrfSq5j4AhmZe.uiLW.694J_8sJ5R3SpPtmoMLi5Wmloe5cSBW. p1yLtSHMVhojY1aQkYAKSGpjslyZLw6Fq3olYIWC3ko_AuJQvXocxz08aRkf 160O3ekMWox8xq7at_79uINmtobUVncDaxjR2C2C7EZh3Y7YzF8d9qIulX.1 zj6YWdyMkTCSQSBWHK7ZMR3QgGAsgHt6dABLTfRLnk6C4QFP_5INTkLwchH4 SoFC5aMVnX9x9wXY_OvGdnKHxWLM5hxIIsYVsk941sTFXV4u.r6jWod5KwLr R93ZCIiRn82oEjhyGH8bahY4e.xYmGsdt8F83xQk4gyraJ.n6e4u.NLqUIym ZH.6IMYOIqSdkY_1X_29Y8smMFqx0whIzyF8YCAodsQQ7OMlyhVnJ7w6c8XW v_o.Pxk_61oFc5k2xlftBIcVn X-Yahoo-SMTP: HT5UJDeswBACWJPOeualxAa.da..S.fl X-Rocket-Received: from [10.85.254.75] (fpjunqueira@94.245.87.186 with ) by smtp144.mail.ir2.yahoo.com with SMTP; 26 Nov 2013 10:09:39 +0000 UTC Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Leader election in C# client From: Flavio Junqueira In-Reply-To: <7B36F63619C46A49B86E0D5AB8CDD200617029B9@emea-tc2-mb02.internal.sungard.corp> Date: Tue, 26 Nov 2013 10:09:38 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <52782939-C1C4-4892-BB95-6ECDBE869B63@yahoo.com> References: <7B36F63619C46A49B86E0D5AB8CDD200617029B9@emea-tc2-mb02.internal.sungard.corp> To: user@zookeeper.apache.org X-Mailer: Apple Mail (2.1508) X-Virus-Checked: Checked by ClamAV on apache.org Hi Ben, I'm not familiar with the C# implementation, but I suspect that: - The session id is indeed to be able to identify the znode in the case = the client sees a connection loss event and reexecutes the create; - The sequence number creates an order among the bidders so that when a = master crashes (ephemeral znode goes away), not all clients are = notified. This solves the herd effect problem: many nodes being notified = upon a single znode going away. -Flavio On Nov 26, 2013, at 9:57 AM, wrote: > Hi, >=20 > I was looking at the leader election algorithm in the .NET client at = https://github.com/ewhauser/zookeeper/blob/trunk/src/dotnet/ZooKeeperNet.R= ecipes/LeaderElection.cs >=20 > There is a point I don't understand and I was wondering if someone = could clarify for me. The recipe creates ephemeral nodes of the form = "election--", I think to be able to see if it = has already created the node (perhaps due to a retry?). However, doesn't = having the session id in the node name then throw out the sorting of the = nodes in the next step, to find the previous node to watch? I'd have = thought it would then be sorting by session id and not sequential id? = Perhaps that doesn't matter as long as only one node gets picked? >=20 > Thanks, > Ben >=20 > Ben Young . Senior Software Engineer . Adaptiv . Position, Risk & = Operations . SunGard . Enterprise House, Histon, Cambridge, CB24 9ZR . = Tel +44 (0) 1223 266042 . ben.young@sungard.com . www.sungard.com >=20 > =20 >=20 >=20 >=20