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 4C8DEEED7 for ; Sun, 3 Mar 2013 09:52:17 +0000 (UTC) Received: (qmail 77668 invoked by uid 500); 3 Mar 2013 09:52:15 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 76726 invoked by uid 500); 3 Mar 2013 09:52: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 76678 invoked by uid 99); 3 Mar 2013 09:52:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Mar 2013 09:52:09 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rakeshr@huawei.com designates 119.145.14.65 as permitted sender) Received: from [119.145.14.65] (HELO szxga02-in.huawei.com) (119.145.14.65) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Mar 2013 09:52:04 +0000 Received: from 172.24.2.119 (EHLO szxeml207-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id AXY60581; Sun, 03 Mar 2013 17:51:42 +0800 (CST) Received: from SZXEML421-HUB.china.huawei.com (10.82.67.160) by szxeml207-edg.china.huawei.com (172.24.2.56) with Microsoft SMTP Server (TLS) id 14.1.323.7; Sun, 3 Mar 2013 17:51:40 +0800 Received: from szxeml561-mbx.china.huawei.com ([169.254.5.163]) by szxeml421-hub.china.huawei.com ([10.82.67.160]) with mapi id 14.01.0323.007; Sun, 3 Mar 2013 17:51:40 +0800 From: Rakesh R To: "user@zookeeper.apache.org" CC: "zookeeper-user@hadoop.apache.org" Subject: RE: Consistency in zookeeper Thread-Topic: Consistency in zookeeper Thread-Index: AQHOFgxX9791ebmg4k+PxAzFSvapjZiPai2AgADfG2eAAE7RAIAACEiAgAAmDwCAAAQ9AIAAB4+AgAAF44CAAAM7gIAAAzuAgABDkwCAApQD6g== Date: Sun, 3 Mar 2013 09:51:39 +0000 Message-ID: References: <1362094516049-7578531.post@n2.nabble.com> <1362171044682-7578540.post@n2.nabble.com> <1362173931985-7578542.post@n2.nabble.com> <5AE3EED8-8E68-455C-96CA-C5EB11E3CA58@jordanzimmerman.com>, In-Reply-To: Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.18.96.96] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Virus-Checked: Checked by ClamAV on apache.org sync() guarantees that it will synchronize the data between the zk servers = at 't' th time. Say we have two clients and both are working on the same key path: First client C1, is updating the value of x at 't1', 't2' and 't3' as follo= ws. at t1 time, value of x =3D 4 at t2 time, update value of x =3D 5 at t3 time, update value of x =3D 6 Second client C2, which is doing sync() at 't2' time and invoke a read() re= q at 't3' time.=20 (Ignoring the race condition between the updation of C1 and sync of C2, her= e assume C1 update has happened first). Now C2 will see value of x=3D5 from= any of the ZK servers(Leader/Followers), but C2 is not guranteed to see va= lue of x=3D6, as updation happened after sync() api call. -Rakesh ________________________________________ From: Ted Dunning [ted.dunning@gmail.com] Sent: Saturday, March 02, 2013 7:33 AM To: user@zookeeper.apache.org Subject: Re: Consistency in zookeeper Yes. Sync doesn't guarantee up to date. It guarantees an ordering. It guarantees that if event A involves a ZK update and if you can guarantee that A occurs before sync, then any read on a client C that is done after a sync on C will see a successor state of A. On Fri, Mar 1, 2013 at 2:01 PM, Jordan Zimmerman wrote: > Even if you do the sync, another client can make a change before you do > the subsequent read. > > -JZ > > On Mar 1, 2013, at 1:50 PM, Martin Kou wrote: > > > Yasin, > > > > If the two clients are connected to two different ZooKeeper servers in > the > > cluster, then, yes. > > > > Generally, if you're worried that there may be another client working o= n > > the same key path, then you should sync() before reading. > > > > Best Regards, > > Martin Kou > > > > On Fri, Mar 1, 2013 at 1:38 PM, Yasin wrote: > > > >> So, if the read request is made by some other client, it will not get > the > >> updated value without sync, right? > >> > >> > >> > >> -- > >> View this message in context: > >> > http://zookeeper-user.578899.n2.nabble.com/Consistency-in-zookeeper-tp757= 8531p7578542.html > >> Sent from the zookeeper-user mailing list archive at Nabble.com. > >> > >=