gen leader

Martin J. Logan mlogan@REDACTED
Wed May 5 16:56:13 CEST 2004

The gen leader is a nice and quite useful piece of code. I am eager to
get my hands on the updated version. As far as the one node situation is
concerned my thoughts are I have a cluster of nodes and by virtue of the
fact that I am using the gen leader I would like there to be a leader. A
cluster of nodes to me is one or many distributed nodes. Say I am using
the gen_leader:leader_call to achieve something if I cannot elect a
leader even in the trivial case of a single node then I have to do have
a case statement

case nodes() of
    []    -> use the standard gen_leader:call
    Nodes -> use the gen_leader:leader_call

I must then also add code to handle these two cases in my gen leader
callback module. For me it would be easier just to have the leader say
"oh there is no one else around... well then I am the leader"


On Wed, 2004-05-05 at 04:53, Thomas Arts wrote:
> Dear Martin
> I am very glad to read that you can actually use the gen_leader code
> and that it works fine for you. A while ago I posted a warning that there
> still is a bug in the code that might cause you a daedlock, but we are
> near to having a fix for that. New code has been written based on a
> different algorithm (Scott D Stroller, "Leader Election in Distributed
> Systems
> with Crash Failures, 1997). We are verifying the code at the moment,
> not to make the same mistake again :0).
> The reason why we excluded the one node case for the leader
> election algorithm is that we saw it as an implementation to
> support fault tolerance. In case of 1 node, there is no fault
> tolerance and a leader election for it seemed useless to us.
> Best regards
> Thomas
> ---
> Dr Thomas Arts
>      Program Manager
>      Software Engineering and Management
> IT-university in Gothenburg
> Box 8718, 402 75 Gothenburg, Sweden
> Tel +46 31 772 6031
> Fax +46 31 772 4899
> ----- Original Message ----- 
> From: "Martin J. Logan" <mlogan@REDACTED>
> To: <erlang-questions@REDACTED>
> Sent: Tuesday, May 04, 2004 6:31 PM
> Subject: gen leader
> > This message is directed at the authors of gen_leader. I have been
> > playing with the gen_leader code of jungerl fame. This code is just what
> > is needed obviate all of our "global" problems. I do have one question
> > about the gen_leader code. If I start a gen_leader in a node cluster
> > consisting of a single node() the single gen_leader process will not
> > elect itself leader. I have to fake it by saying
> > gen_leader:start_link(leader, [node(), fake_node], [],
> > gen_leader_callback, Args, Options).
> >
> > What is the reason that gen_leader wants another gen_leader to dominate
> > and is not content to be his own boss:-)
> >
> > Cheers,
> > Martin
> >
> > P.S how does jungerl become erlpan i.e more people know, love, and use
> > it?
> >
> >

More information about the erlang-questions mailing list