zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Reed <br...@apache.org>
Subject Re: a misunderstanding of ZAB
Date Thu, 05 Sep 2019 03:33:52 GMT
the key is what alex said: p1 can be committed or dropped. it was not
delivered to a quorum. (if it was, it must be delivered to everyone.)
it wasn't skipped. it would be skipped if a new leader did not deliver
it and proposed new messages. thus, since it isn't delivered or
skipped, skipping it or delivering it are both acceptable answers.
however, once it gets delivered or skipped, it must stay that way :)


On Tue, Sep 3, 2019 at 4:52 AM Norbert Kalmar
<nkalmar@cloudera.com.invalid> wrote:
> Hi,
> That's a good question. So if I understand correctly, you are asking what
> happens if there is a new Leader Election in ZooKeeper, what is the "last
> seen zxid". I checked the ZAB protocol, it is not entirely clear for me as
> well, but my understanding is that the last seen zxid is the last
> transaction, which is read from txnlogs in case of a recovery. Honestly,
> there's nothing else this could be read from. So if it hasn't been
> committed to the datatree (and that exists in memory anyway, at least until
> a snapshot is taken), it is still the last txn that is logged by one of the
> followers, so he will win the Leader Election, and the followers will get
> this txn as well.
> Anyone agree/disagree? :)
> Regards,
> Norbert
> On Mon, Sep 2, 2019 at 4:50 AM 121476721@qq.com <121476721@qq.com> wrote:
> > hi, i'm a new to zookeeper, and this problem confuses me for nearly two
> > months...
> > papers tell me that zab must satisfy:
> > A message delivered by one sever must be delivered on quorum.
> > A message skipped must always be skipped.
> > Then consider two cases below, L is short for leader, F is short for
> > follower, p is short for proposal.
> > Case1:
> > L send p1 to F2 F3 F4 F5.
> > F2 F3 ack p1, reach a quorum.
> > L1 is about to send commit but failed...
> > L2 become new leader, he should commit.
> >
> > Case2:
> > L1 send p1 to F2 F3 F4 F5.
> > Only F2 ack p1, not reach a quorum.
> > Then L1 failed...
> > L2 become new leader, he should skip p1.
> >
> > i think L2 should handle the cases in election&recovery phase. but how L2
> > can know the global state and decide if commit p1 or skip p1?
> > if anyone helps, i will be much appreciate.
> >
> >
> >
> > 121476721@qq.com
> >

View raw message