zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nauroth <cnaur...@hortonworks.com>
Subject Re: Why can't an ephemeral non sequential node creation be used as a lock?
Date Tue, 03 Nov 2015 18:48:44 GMT
Yes, agreed.  My response raced with Flavio's.  That also gives you a sort
of real-world demo of the thundering herd effect.  :-)

--Chris Nauroth




On 11/3/15, 10:38 AM, "Flavio Junqueira" <fpj@apache.org> wrote:

>There is nothing wrong with what you described. The one undesirable
>effect of doing the way you describe is that all clients watching will
>wake when the ephemeral is deleted. Assuming the recipe you're talking
>about is the one that chains watches, it avoids waking up all clients
>when the ephemeral is deleted.
>
>-Flavio
>
>
>> On 03 Nov 2015, at 18:30, kamel.zaarouri@gmail.com wrote:
>> 
>> Hi,
>> 
>> I have 3 zookeeper clients that will receive a request within seconds
>>apart.  Only 1 client is allowed to handle this request.
>> 
>> I was thinking that each client will try to create the same ephemeral
>>node non sequential node. The client that can is by definition the
>>leader and is the one that will handle the request.
>> 
>> But then I saw that there's a recipe for creating a lock.
>> 
>> Would the above strategy work or should I use the recipe? Can someone
>>tell me what could go wrong with what I described?
>> 
>> Thanks
>
>


Mime
View raw message