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" <[email protected]> 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, [email protected] 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 > >
