Return-Path: X-Original-To: apmail-curator-user-archive@minotaur.apache.org Delivered-To: apmail-curator-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A94E108A3 for ; Wed, 11 Sep 2013 08:40:43 +0000 (UTC) Received: (qmail 64375 invoked by uid 500); 11 Sep 2013 08:40:42 -0000 Delivered-To: apmail-curator-user-archive@curator.apache.org Received: (qmail 64293 invoked by uid 500); 11 Sep 2013 08:40:41 -0000 Mailing-List: contact user-help@curator.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@curator.incubator.apache.org Delivered-To: mailing list user@curator.incubator.apache.org Received: (qmail 64278 invoked by uid 99); 11 Sep 2013 08:40:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Sep 2013 08:40:40 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of azilberstein@salesforce.com designates 74.125.82.46 as permitted sender) Received: from [74.125.82.46] (HELO mail-wg0-f46.google.com) (74.125.82.46) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Sep 2013 08:40:32 +0000 Received: by mail-wg0-f46.google.com with SMTP id k14so7473710wgh.13 for ; Wed, 11 Sep 2013 01:40:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=OZKozXNvLgotmyChW9eBP92SYJQDLAfioXK+ZqHSMu0=; b=M1i5AbiBdYZHWh5t+925+n8SJS+INMpa72aG1G86lM6vrSkFge/TCsbpvrbdDkBp/X O5EIS5t9dp+hUPBfQF6iBchuJCgNDFOIZxDMhDlPDqsZfP7D+PSUPhUKv6b8FODBwmTl 5EMTsz32/ToqRhXR3ch9Wghxl/gopzOyWhLjXAIPTXpzh01zOy+MF73yq2/GNx6ipXN9 8U31Z9RdQ0Dc2AwArvlt8KCPF9JWTgtWcfShBIJNfjK3Pef4yX44bFE2R9EqzGqlXp69 G28/eFuc4myraxx9bzujSEB88gnzYOoux1CainuUnGvAiWX6J7lLpQ6EGYAVhawcuT53 T5Pw== X-Gm-Message-State: ALoCoQlNv/mv5w7TpZ0LjllU9/hKUtlOAVtlybkwKySLkv8gv9arsc4AH7MF+IQ/lhdd9sBIhAjf MIME-Version: 1.0 X-Received: by 10.194.110.138 with SMTP id ia10mr402669wjb.3.1378888810597; Wed, 11 Sep 2013 01:40:10 -0700 (PDT) Received: by 10.216.63.207 with HTTP; Wed, 11 Sep 2013 01:40:10 -0700 (PDT) Date: Wed, 11 Sep 2013 11:40:10 +0300 Message-ID: Subject: Atomically setting a node's data while having leadership From: Arie Zilberstein To: user@curator.incubator.apache.org Content-Type: multipart/alternative; boundary=047d7bf10aa8bdab5004e617918b X-Virus-Checked: Checked by ClamAV on apache.org --047d7bf10aa8bdab5004e617918b Content-Type: text/plain; charset=ISO-8859-1 Hi, I wonder if it is possible to achieve the following behavior: Assume a leader election scenario where a certain process has been elected as leader and its takeLeadership() method was called. Inside that method the process wishes to perform a Zookeeper operation, e.g., to set data in a node. But, the leader may receive a message saying to relinquish leadership immediately at any point in time. So the question is, is it possible to set this data while making sure that we're still the leader? Can Curator support this sort of an atomic "test-and-set" operation? Thanks, Arie --047d7bf10aa8bdab5004e617918b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

I wonder if it is possible to achie= ve the following behavior: Assume a leader election scenario where a certai= n process has been elected as leader and its=A0takeLeadership() method was = called. Inside that method the process wishes to perform a Zookeeper operat= ion, e.g., to set data in a node. But, the leader may receive a message say= ing to relinquish leadership immediately at any point in time. So the quest= ion is, is it possible to set this data while making sure that we're st= ill the leader?
Can Curator support this sort of an atomic "test-and-set" op= eration?

Thanks,
Arie
--047d7bf10aa8bdab5004e617918b--