You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Jordan Zimmerman <jz...@netflix.com> on 2011/11/11 07:29:59 UTC

More sync questions

A while back I asked about sync() and got responses that said it's only needed for reads (getData, getChildren). I was looking through the source and it appears that this does _not_ apply to exsists(). Am I reading that correctly? i.e. will exists() always return an accurate (in terms of the leader) view of a node's metadata?

-JZ

Re: More sync questions

Posted by Flavio Junqueira <fp...@yahoo-inc.com>.
Hi Jordan, exists is a read operation, check processRequest in  
FinalRequestProcessor.

-Flavio

On Nov 23, 2011, at 7:53 PM, Jordan Zimmerman wrote:

> Flavio, what I saw in the code (bear in mind I've only casually  
> looked at
> the code) is that getData, getChildren, etc. use the local server's  
> view.
> exists() appears to follow the same path as create(), etc. in that  
> it goes
> through the leader.
>
> -JZ
>
> On 11/23/11 10:23 AM, "Flavio Junqueira" <fp...@yahoo-inc.com> wrote:
>
>> In the way I understood the question, Jordan seems to have observed
>> that sync() is not affecting exists (correct me if I'm wrong,  
>> please).
>> If that's the case, then I believe we have a bug.
>>
>> -Flavio
>>
>> On Nov 23, 2011, at 6:01 PM, Patrick Hunt wrote:
>>
>>> On Thu, Nov 10, 2011 at 10:29 PM, Jordan Zimmerman
>>> <jz...@netflix.com> wrote:
>>>> A while back I asked about sync() and got responses that said it's
>>>> only needed for reads (getData, getChildren). I was looking through
>>>> the source and it appears that this does _not_ apply to exsists().
>>>> Am I reading that correctly? i.e. will exists() always return an
>>>> accurate (in terms of the leader) view of a node's metadata?
>>>
>>> No, sync applies to any read. We call it "slow read" in some cases
>>> because it forces the follower to get up to date with the leader.
>>>
>>> Keep in mind that any read from any server is never "accurate" at
>>> least in the sense that you likely mean it. e.g. the state of
>>> leadership may change btw the time the server responds to your  
>>> exists
>>> call and the time it takes for TCP/OS to propagate the response to
>>> your client.
>>> http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing
>>>
>>> Patrick
>>
>> flavio
>> junqueira
>>
>> research scientist
>>
>> fpj@yahoo-inc.com
>> direct +34 93-183-8828
>>
>> avinguda diagonal 177, 8th floor, barcelona, 08018, es
>> phone (408) 349 3300    fax (408) 349 3301
>>
>

flavio
junqueira

research scientist

fpj@yahoo-inc.com
direct +34 93-183-8828

avinguda diagonal 177, 8th floor, barcelona, 08018, es
phone (408) 349 3300    fax (408) 349 3301


Re: More sync questions

Posted by Jordan Zimmerman <jz...@netflix.com>.
Flavio, what I saw in the code (bear in mind I've only casually looked at
the code) is that getData, getChildren, etc. use the local server's view.
exists() appears to follow the same path as create(), etc. in that it goes
through the leader.

-JZ

On 11/23/11 10:23 AM, "Flavio Junqueira" <fp...@yahoo-inc.com> wrote:

>In the way I understood the question, Jordan seems to have observed
>that sync() is not affecting exists (correct me if I'm wrong, please).
>If that's the case, then I believe we have a bug.
>
>-Flavio
>
>On Nov 23, 2011, at 6:01 PM, Patrick Hunt wrote:
>
>> On Thu, Nov 10, 2011 at 10:29 PM, Jordan Zimmerman
>> <jz...@netflix.com> wrote:
>>> A while back I asked about sync() and got responses that said it's
>>> only needed for reads (getData, getChildren). I was looking through
>>> the source and it appears that this does _not_ apply to exsists().
>>> Am I reading that correctly? i.e. will exists() always return an
>>> accurate (in terms of the leader) view of a node's metadata?
>>
>> No, sync applies to any read. We call it "slow read" in some cases
>> because it forces the follower to get up to date with the leader.
>>
>> Keep in mind that any read from any server is never "accurate" at
>> least in the sense that you likely mean it. e.g. the state of
>> leadership may change btw the time the server responds to your exists
>> call and the time it takes for TCP/OS to propagate the response to
>> your client.
>> http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing
>>
>> Patrick
>
>flavio
>junqueira
>
>research scientist
>
>fpj@yahoo-inc.com
>direct +34 93-183-8828
>
>avinguda diagonal 177, 8th floor, barcelona, 08018, es
>phone (408) 349 3300    fax (408) 349 3301
>


Re: More sync questions

Posted by Flavio Junqueira <fp...@yahoo-inc.com>.
In the way I understood the question, Jordan seems to have observed  
that sync() is not affecting exists (correct me if I'm wrong, please).  
If that's the case, then I believe we have a bug.

-Flavio

On Nov 23, 2011, at 6:01 PM, Patrick Hunt wrote:

> On Thu, Nov 10, 2011 at 10:29 PM, Jordan Zimmerman
> <jz...@netflix.com> wrote:
>> A while back I asked about sync() and got responses that said it's  
>> only needed for reads (getData, getChildren). I was looking through  
>> the source and it appears that this does _not_ apply to exsists().  
>> Am I reading that correctly? i.e. will exists() always return an  
>> accurate (in terms of the leader) view of a node's metadata?
>
> No, sync applies to any read. We call it "slow read" in some cases
> because it forces the follower to get up to date with the leader.
>
> Keep in mind that any read from any server is never "accurate" at
> least in the sense that you likely mean it. e.g. the state of
> leadership may change btw the time the server responds to your exists
> call and the time it takes for TCP/OS to propagate the response to
> your client.
> http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing
>
> Patrick

flavio
junqueira

research scientist

fpj@yahoo-inc.com
direct +34 93-183-8828

avinguda diagonal 177, 8th floor, barcelona, 08018, es
phone (408) 349 3300    fax (408) 349 3301


Re: More sync questions

Posted by Patrick Hunt <ph...@apache.org>.
On Thu, Nov 10, 2011 at 10:29 PM, Jordan Zimmerman
<jz...@netflix.com> wrote:
> A while back I asked about sync() and got responses that said it's only needed for reads (getData, getChildren). I was looking through the source and it appears that this does _not_ apply to exsists(). Am I reading that correctly? i.e. will exists() always return an accurate (in terms of the leader) view of a node's metadata?

No, sync applies to any read. We call it "slow read" in some cases
because it forces the follower to get up to date with the leader.

Keep in mind that any read from any server is never "accurate" at
least in the sense that you likely mean it. e.g. the state of
leadership may change btw the time the server responds to your exists
call and the time it takes for TCP/OS to propagate the response to
your client.
http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing

Patrick