zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kamel.zaaro...@gmail.com
Subject Why can't an ephemeral non sequential node creation be used as a lock?
Date Tue, 03 Nov 2015 18:30:12 GMT
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