curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Ferreira <ricardojs...@gmail.com>
Subject Regarding leadership status
Date Tue, 27 Jan 2015 09:20:07 GMT
Hello all,


I'm using Zookeeper (through Curator) for leadership election on an
application I'm currently developing.

Some operations can only be written by one of the members of the cluster,
so I'm using a node's leadership
status to this effect.

For example, let's say a message arrives to all nodes but only one should
do something about it. What I do
is to check if the node is leader (through LeaderSelector#hasLeadership()),
and if it is then it does whatever
it needs to do with the message. If it's not, it simply ignores it.

My question is this: How can I be sure a node *really is* the leader? What
if the leader node is actually down but
this hasn't been detected by Zookeeper yet? Then the non-leader nodes will
ignore the message and it will
never be processed.

How is this usually dealt with?


Regards

Mime
View raw message