You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Chen Bangzhong <ba...@gmail.com> on 2010/04/29 11:58:37 UTC

zookeeper consistency model?

If client A and Client B both connects to Zookeeper,  A updates one znode
and succeed, assume B connects to a server that haven't  persisted the
update yet, eg. the server is  in minority, what value will B read? new
value or older value? what if B calls sync before read the znode?

Re: zookeeper consistency model?

Posted by Ted Dunning <te...@gmail.com>.
I tend to say that the cost of Now scales very badly with the diameter of
the Now that you are buying.  A 5 cm Now is quite cheap.  A 10 m Now is
quite expensive and the cost of a 1000 km Now is more than you can imagine.

On Thu, Apr 29, 2010 at 9:55 AM, Patrick Hunt <ph...@apache.org> wrote:

> Ted, this is my browser homepage ;-)
> http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing
>
> Patrick
>
>
> On 04/29/2010 09:14 AM, Ted Dunning wrote:
>
>> In general, the guarantee is that B will do exactly as you say.... it will
>> read the new value or the old value.  Your question depends on a
>> definition
>> of "now" that spans several machines.  That is a dangerous concept and if
>> your reasoning requires it, you are headed for trouble.
>>
>> On Thu, Apr 29, 2010 at 2:58 AM, Chen Bangzhong<ba...@gmail.com>
>>  wrote:
>>
>>  , what value will B read? new
>>> value or older value?
>>>
>>>
>>

Re: zookeeper consistency model?

Posted by Patrick Hunt <ph...@apache.org>.
Ted, this is my browser homepage ;-)
http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing

Patrick

On 04/29/2010 09:14 AM, Ted Dunning wrote:
> In general, the guarantee is that B will do exactly as you say.... it will
> read the new value or the old value.  Your question depends on a definition
> of "now" that spans several machines.  That is a dangerous concept and if
> your reasoning requires it, you are headed for trouble.
>
> On Thu, Apr 29, 2010 at 2:58 AM, Chen Bangzhong<ba...@gmail.com>  wrote:
>
>> , what value will B read? new
>> value or older value?
>>
>

Re: zookeeper consistency model?

Posted by Ted Dunning <te...@gmail.com>.
In general, the guarantee is that B will do exactly as you say.... it will
read the new value or the old value.  Your question depends on a definition
of "now" that spans several machines.  That is a dangerous concept and if
your reasoning requires it, you are headed for trouble.

On Thu, Apr 29, 2010 at 2:58 AM, Chen Bangzhong <ba...@gmail.com> wrote:

> , what value will B read? new
> value or older value?
>

Re: zookeeper consistency model?

Posted by Patrick Hunt <ph...@apache.org>.
Hi Chen, this section of the docs has details on our guarantees, in 
particular see the note:

http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkGuarantees

Patrick

On 04/29/2010 07:42 AM, Flavio Junqueira wrote:
> Hi Chen, Let's say that the value of a znode "/test" is initially v and
> client A writes value v' to znode "/test". If the server that client B
> is connected to has not persisted the update operation of A, it will
> read v. If it submits sync before the read, client B will read v'.
>
> -Flavio
>
> On Apr 29, 2010, at 11:58 AM, Chen Bangzhong wrote:
>
>> If client A and Client B both connects to Zookeeper, A updates one znode
>> and succeed, assume B connects to a server that haven't persisted the
>> update yet, eg. the server is in minority, what value will B read? new
>> value or older value? what if B calls sync before read the znode?
>

Re: zookeeper consistency model?

Posted by Flavio Junqueira <fp...@yahoo-inc.com>.
Hi Chen, Let's say that the value of a znode "/test" is initially v  
and client A writes value v' to znode "/test". If the server that  
client B is connected to has not persisted the update operation of A,  
it will read v. If it submits sync before the read, client B will read  
v'.

-Flavio

On Apr 29, 2010, at 11:58 AM, Chen Bangzhong wrote:

> If client A and Client B both connects to Zookeeper,  A updates one  
> znode
> and succeed, assume B connects to a server that haven't  persisted the
> update yet, eg. the server is  in minority, what value will B read?  
> new
> value or older value? what if B calls sync before read the znode?