You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by yuzhou li <ia...@gmail.com> on 2018/06/10 08:18:17 UTC

what's the different between acceptedEpoch and currentEpoch?

Hi everyone.I am a zk source code learner  I have some confusion when I
read the source code of zk leader failover phase.This phase has two epoch
acceptedEpoch and currentEpoch. But I don't understand why acceptEpoch is
needed instead of using currentEpoch directly?

Re: what's the different between acceptedEpoch and currentEpoch?

Posted by yuzhou li <ia...@gmail.com>.
Thank you very much!

Michael Han <ha...@apache.org> 于2018年6月11日周一 下午2:04写道:

> The two variables serve different purposes. acceptedEpoch stores the epoch
> of the last NEWEPOCH message received and currentEpoch stores the epoch of
> the last NEWLEADER message received. They were introduced in ZOOKEEPER-335,
> please check that JIRA if you are interested.
>
> I think the ZAB protocol itself does not require the separation of
> maintaining two epoch states (the paper only has a concept of current
> epoch) so this is more like an implementation issue that we need a way to
> distinguish tried epoch during election (acceptedEpoch) versus stable epoch
> (currentEpoch) after leader election to solve what's reported in ZK-335.
>
> On Sun, Jun 10, 2018 at 1:18 AM, yuzhou li <ia...@gmail.com> wrote:
>
> > Hi everyone.I am a zk source code learner  I have some confusion when I
> > read the source code of zk leader failover phase.This phase has two epoch
> > acceptedEpoch and currentEpoch. But I don't understand why acceptEpoch is
> > needed instead of using currentEpoch directly?
> >
>

Re: what's the different between acceptedEpoch and currentEpoch?

Posted by Michael Han <ha...@apache.org>.
The two variables serve different purposes. acceptedEpoch stores the epoch
of the last NEWEPOCH message received and currentEpoch stores the epoch of
the last NEWLEADER message received. They were introduced in ZOOKEEPER-335,
please check that JIRA if you are interested.

I think the ZAB protocol itself does not require the separation of
maintaining two epoch states (the paper only has a concept of current
epoch) so this is more like an implementation issue that we need a way to
distinguish tried epoch during election (acceptedEpoch) versus stable epoch
(currentEpoch) after leader election to solve what's reported in ZK-335.

On Sun, Jun 10, 2018 at 1:18 AM, yuzhou li <ia...@gmail.com> wrote:

> Hi everyone.I am a zk source code learner  I have some confusion when I
> read the source code of zk leader failover phase.This phase has two epoch
> acceptedEpoch and currentEpoch. But I don't understand why acceptEpoch is
> needed instead of using currentEpoch directly?
>