zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jzimmer...@netflix.com>
Subject Re: Missing session state handling in most Leader Election implementations
Date Mon, 14 Nov 2011 22:41:35 GMT
It turns out that this is tricky to solve. When the server you're
connected to goes down, you get a Watcher.Event.KeeperState.Disconnected.
However, it could be that you are able to reconnect to another server so
the disconnected event should be ignored. My solution is to watch for
Watcher.Event.KeeperState.Disconnected and then execute a sync() (using
the currently configured retry policy). If that sync fails, Curator will
call the unhandledError() method of the LeaderSelectorListener. This seems
like the best way to handle this. Thoughts?

As an aside, as part of working on this I now have a TestingCluster class
that will create, in memory, n ZooKeeper servers in an ensemble. This
could be useful to everyone :)

-JZ

On 11/14/11 3:25 AM, "Jérémie BORDIER" <jeremie.bordier@gmail.com> wrote:

>I'd be really happy to
>contribute as we plan on using Curator, but I think this may impact
>all the recipes so you're probably the best person to link these bits
>together.


Mime
View raw message