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 <eric.van.ors...@gmail.com>wrote: > 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 <my_ip_address> > > if creation succeeded then { > > // do the leader thing > > } else { > > // wait for change in /election using watcher mechanism > > } > > } > > > > My assumption is that the recipe is more elaborate to the eliminate the > flood of requests if the leader falls away. > > But if there are only a handful of leader-candidates ,than that should not > be a problem. > > > > Is this correct, or am I missing out on something. > > > > Thanks, > > Eric > > > >