zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shraer <shra...@yahoo-inc.com>
Subject RE: Possibility / consequences of having multiple elected leaders
Date Thu, 08 Mar 2012 23:09:16 GMT
Thanks Ted, I can see your point. We use TCP connections and we do the epoch check at the beginning
of the protocol, so
a message from an old leader cannot just resurface.


From: Ted Dunning [mailto:ted.dunning@gmail.com]
Sent: Thursday, March 08, 2012 12:32 AM
To: Alexander Shraer
Cc: user@zookeeper.apache.org
Subject: Re: Possibility / consequences of having multiple elected leaders

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 <shralex@yahoo-inc.com<mailto:shralex@yahoo-inc.com>>
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:ted.dunning@gmail.com]
Sent: Wednesday, March 07, 2012 4:55 PM
To: Alexander Shraer
Cc: user@zookeeper.apache.org<mailto:user@zookeeper.apache.org>
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 <shralex@yahoo-inc.com<mailto:shralex@yahoo-inc.com>>
> 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,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message