From user-return-7056-apmail-zookeeper-user-archive=zookeeper.apache.org@zookeeper.apache.org Tue Nov 26 22:34:47 2013 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 1445F10CA4 for ; Tue, 26 Nov 2013 22:34:47 +0000 (UTC) Received: (qmail 9934 invoked by uid 500); 26 Nov 2013 22:34:46 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 9903 invoked by uid 500); 26 Nov 2013 22:34:46 -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 9895 invoked by uid 99); 26 Nov 2013 22:34:46 -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 22:34:46 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mckenzie.cam@gmail.com designates 209.85.160.50 as permitted sender) Received: from [209.85.160.50] (HELO mail-pb0-f50.google.com) (209.85.160.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Nov 2013 22:34:41 +0000 Received: by mail-pb0-f50.google.com with SMTP id rr13so8917164pbb.23 for ; Tue, 26 Nov 2013 14:34:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=PsYXnoRFXjjMOfZqFzLvbWkJXqlcg0yjGj7KlYIkrbs=; b=hOGp+dqMAlqIf2YSEVcuOfxKmKKo2aL+1jegT4lOZINwPR2V7/BOxRnKIkw+6OQwJw 8fZ05fPvOGgpVy2YBCzj3Fm16TDZBtiGUm/R/LmYnGGP/Rsa8q71aLj3/AuKxJ/Lv1Fn On0yOSdV9KZeGD/izPf7eTTWAx0LWT27SiHQudvm0dH3xn6xKMizDAPEkr0Z9+grvCNT T0qePH0z6H5vsL9oLaaLIpfjvRXzh4uLLzQkxSWUKKjW1+nqhUhChX/wTH5ONL5DRVMV E6DtfEnYpfUn9CsryfAU5MQ9vAmIf+vJRVkw6PrRAk/pPtLx7vHyoRPurL9xXCttLuXw 6KFA== MIME-Version: 1.0 X-Received: by 10.67.5.227 with SMTP id cp3mr7270705pad.186.1385505260967; Tue, 26 Nov 2013 14:34:20 -0800 (PST) Received: by 10.68.145.40 with HTTP; Tue, 26 Nov 2013 14:34:20 -0800 (PST) In-Reply-To: <1385504882746-7579376.post@n2.nabble.com> References: <1385456084052-7579367.post@n2.nabble.com> <1385504882746-7579376.post@n2.nabble.com> Date: Wed, 27 Nov 2013 09:34:20 +1100 Message-ID: Subject: Re: Ensure there is one master From: Cameron McKenzie To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=047d7b1600b7ea1d9e04ec1c147c X-Virus-Checked: Checked by ClamAV on apache.org --047d7b1600b7ea1d9e04ec1c147c Content-Type: text/plain; charset=ISO-8859-1 If I'm understanding your question correctly, you're worried that when the current 'master' loses its connection to ZooKeeper, a new 'master' will be elected and you will have 2 'master' nodes at the same time. As soon as you lose a connection to ZooKeeper there are no guarantees about any of the state that you're determining from it. When you lose the ZooKeeper connection, your 'master' must assume that it is no longer a 'master' node until it reconnects to ZooKeeper, at which point it will be able to work out what's going on. If you look at Apache Curator, its implementation of the Leader latch recipe handles this loss of connection and reestablishment. cheers Cam On Wed, Nov 27, 2013 at 9:28 AM, ms209495 wrote: > Thanks for the reply. I want to clarify one thing. > I think about a System of 20 nodes, that uses ZooKeeper of 3 nodes. > I think about master election among these 20 nodes, that do not run > consensus, but they use zookeeper service for master election. > I used 'leader' term for a leeder in Zookeeper (among 3 nodes), and > 'master' > term for master in the System (20 nodes). > Solution is described here: > http://zookeeper.apache.org/doc/trunk/recipes.html#sc_leaderElection (I > would name it 'master' election, not 'leader' election), but I doubt if it > works reliable without additional timing assumptions as I described in my > previous post. > Please consider my previous post in the context of the System that uses > Zookeeper (not ZooKeeper itself). > > > > -- > View this message in context: > http://zookeeper-user.578899.n2.nabble.com/Ensure-there-is-one-master-tp7579367p7579376.html > Sent from the zookeeper-user mailing list archive at Nabble.com. > --047d7b1600b7ea1d9e04ec1c147c--