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 189A110DA5 for ; Tue, 26 Nov 2013 09:58:35 +0000 (UTC) Received: (qmail 71231 invoked by uid 500); 26 Nov 2013 09:58:34 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 70839 invoked by uid 500); 26 Nov 2013 09:58:28 -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 70831 invoked by uid 99); 26 Nov 2013 09:58:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Nov 2013 09:58:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [213.199.154.249] (HELO db9outboundpool.messaging.microsoft.com) (213.199.154.249) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Nov 2013 09:58:23 +0000 Received: from mail9-db9-R.bigfish.com (10.174.16.237) by DB9EHSOBE017.bigfish.com (10.174.14.80) with Microsoft SMTP Server id 14.1.225.22; Tue, 26 Nov 2013 09:58:01 +0000 Received: from mail9-db9 (localhost [127.0.0.1]) by mail9-db9-R.bigfish.com (Postfix) with ESMTP id E00B7C809DE for ; Tue, 26 Nov 2013 09:58:01 +0000 (UTC) X-Forefront-Antispam-Report: CIP:213.86.77.19;KIP:(null);UIP:(null);IPV:NLI;H:emea-tc2-edge01.sungard.com;RD:none;EFVD:NLI X-SpamScore: -1 X-BigFish: VPS-1(zz4015Izz1f42h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h1d1ah1d2ah1fc6hzz1de098h8275bh1de097h186068h18602ehz2dh109h2a8h839h947hd25hf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e1dh1fe8h1ff5h2216h22d0h1155h) Received: from mail9-db9 (localhost.localdomain [127.0.0.1]) by mail9-db9 (MessageSwitch) id 1385459880525944_32765; Tue, 26 Nov 2013 09:58:00 +0000 (UTC) Received: from DB9EHSMHS002.bigfish.com (unknown [10.174.16.237]) by mail9-db9.bigfish.com (Postfix) with ESMTP id 7BF72920034 for ; Tue, 26 Nov 2013 09:58:00 +0000 (UTC) Received: from emea-tc2-edge01.sungard.com (213.86.77.19) by DB9EHSMHS002.bigfish.com (10.174.14.12) with Microsoft SMTP Server (TLS) id 14.16.227.3; Tue, 26 Nov 2013 09:58:00 +0000 Received: from EMEA-TC2-CAS01.internal.sungard.corp (10.254.236.2) by emea-tc2-edge01.sungard.com (213.86.77.5) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 26 Nov 2013 09:57:50 +0000 Received: from EMEA-TC2-MB02.internal.sungard.corp ([169.254.2.78]) by emea-tc2-cas01.internal.sungard.corp ([10.254.236.2]) with mapi id 14.03.0123.003; Tue, 26 Nov 2013 09:57:59 +0000 From: To: Subject: Leader election in C# client Thread-Topic: Leader election in C# client Thread-Index: Ac7qjW9SFjQNNdbPRB2aNX7DQrnOKg== Date: Tue, 26 Nov 2013 09:57:59 +0000 Message-ID: <7B36F63619C46A49B86E0D5AB8CDD200617029B9@emea-tc2-mb02.internal.sungard.corp> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.236.238] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: VT_Reflected X-OriginatorOrg: sungard.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-Virus-Checked: Checked by ClamAV on apache.org Hi, I was looking at the leader election algorithm in the .NET client at https:= //github.com/ewhauser/zookeeper/blob/trunk/src/dotnet/ZooKeeperNet.Recipes/= LeaderElection.cs There is a point I don't understand and I was wondering if someone could cl= arify for me. The recipe creates ephemeral nodes of the form "election--", I think to be able to see if it has already create= d the node (perhaps due to a retry?). However, doesn't having the session i= d 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 sor= ting by session id and not sequential id? Perhaps that doesn't matter as lo= ng as only one node gets picked? Thanks, Ben Ben Young=A0.=A0Senior Software Engineer=A0. Adaptiv . Position, Risk & Ope= rations . SunGard . Enterprise House, Histon, Cambridge, CB24 9ZR . =A0Tel = +44 (0) 1223 266042 . ben.young@sungard.com . www.sungard.com =A0