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 00:28:52 GMT
On 11/13/11 3:40 PM, "Jérémie BORDIER" <jeremie.bordier@gmail.com> wrote:

>As noticed in ZOOKEEPER-1209, this can cause really important issues.
>As Leader election is one of the most demanded feature / recipe, I
>would really like to see the official recipe fixed and fully

Curator handles this in its API. Our LeaderSelector takes a listener
instance that has two methods:
    public void         takeLeadership(CuratorFramework client) throws

    public void         notifyClientClosing(CuratorFramework client);

The second method is the important one here. You can think of this like
the JDK's thread interruption mechanism. If a split brain occurs, the
leader connected to the bad half will have its notifyClientClosing method

BTW - all of our recipes have this kind of mechanism.


View raw message