Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper, mail # user - Possibility / consequences of having multiple elected leaders


Copy link to this message
-
Re: Possibility / consequences of having multiple elected leaders
Ted Dunning 2012-03-08, 08:31
The whole point of the zab protocol is to ensure that only one elected leader can exist at one time.  Since a quorum has to commit to supporting any leader there can't be two leaders. Furthermore each change of leadership increments the epoch and that increment had to be committed on a majority of node. That means that only one leader can exist in the latest epoch. Since the latest epoch is, by definition, acknowledged by a majority of nodes, an old leader cannot resurface as a pretender to the throne.

Sent from my iPhone

On Mar 7, 2012, at 7:08 PM, Alexander Shraer <[EMAIL PROTECTED]> wrote:

> I’ve been wondering about this for a while, and suspect that this check doesn’t exist in the code… but I may be wrong.
>  
> From: Ted Dunning [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 07, 2012 4:55 PM
> To: Alexander Shraer
> Cc: [EMAIL PROTECTED]
> Subject: Re: Possibility / consequences of having multiple elected leaders
>  
> Not off the cuff and I have to run away right now.
>  
> On Wed, Mar 7, 2012 at 4:07 PM, Alexander Shraer <[EMAIL PROTECTED]> wrote:
> > Such a commit will be rejected due to an old epoch.
>
> Ted, can you please point me to the place in the code where this check is performed ?
>
> Thanks a lot,
> Alex
>