Re: election recipe

2010-09-06 Thread Patrick Hunt
Hi Andrei, the answer may not be as simple as that. In the case of "passive leader" you might want to just wait till you're reconnected before taking any action. Connection loss indicates that you aren't currently connected to a server, it doesn't mean that you've lost leadership (if you get expire

Re: election recipe

2010-09-04 Thread Andrei Savu
You should also be careful how you handle connection loss events. The leader should suspend itself and re-run the election process when the connection is reestablished. On Sat, Sep 4, 2010 at 8:37 AM, Mahadev Konar wrote: > Hi Eric, >  As Ted and you yourself mentioned its mostly to avoid herd af

Re: election recipe

2010-09-03 Thread Mahadev Konar
Hi Eric, As Ted and you yourself mentioned its mostly to avoid herd affect. A herd affect would usually mean 1000¹s of client notified of some change and would try creating the same node on notification. With just 10¹s of clients you don¹t need to worry abt this herd effect at all. Thanks mahad

Re: election recipe

2010-09-02 Thread Ted Dunning
You are correct that this simpler recipe will work for smaller populations and correct that the complications are to avoid the herd effect. On Thu, Sep 2, 2010 at 12:55 PM, Eric van Orsouw wrote: > Hi there, > > > > I would like to use zookeeper to implement an election scheme. > > There is a r

election recipe

2010-09-02 Thread Eric van Orsouw
Hi there, I would like to use zookeeper to implement an election scheme. There is a recipe on the homepage, but it is relatively complex. I was wondering what was wrong with the following pseudo code; forever { zookeeper.create -e /election if creation succeeded then {