From user-return-12120-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Thu Sep 5 03:34:05 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 50EE61804BB for ; Thu, 5 Sep 2019 05:34:05 +0200 (CEST) Received: (qmail 63889 invoked by uid 500); 5 Sep 2019 10:29:07 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 63860 invoked by uid 99); 5 Sep 2019 10:29:07 -0000 Received: from Unknown (HELO mailrelay1-lw-us.apache.org) (10.10.3.159) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2019 10:29:07 +0000 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 4526D5A1B for ; Thu, 5 Sep 2019 03:34:04 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id p12so1475421iog.5 for ; Wed, 04 Sep 2019 20:34:04 -0700 (PDT) X-Gm-Message-State: APjAAAVQbHk0kolFOQQbF+5PWpaY4nqaa8vEAL/e3vuumR57p/il/19m DSXSIH5PadJLFsl2uboApl+lXkhr9rYmNeiV0QI= X-Google-Smtp-Source: APXvYqzqrt8aE/El2mwCXh9pNPu+DlKEn1OUSIQWbH3seWTw/myiBDNZHGpdozsgsjagHUfqSdCwoCEiQne00imgf+g= X-Received: by 2002:a5d:9ac9:: with SMTP id x9mr1628859ion.55.1567654443978; Wed, 04 Sep 2019 20:34:03 -0700 (PDT) MIME-Version: 1.0 References: <5d6c835a.1c69fb81.9ff1c.d4f3SMTPIN_ADDED_BROKEN@mx.google.com> In-Reply-To: From: Benjamin Reed Date: Wed, 4 Sep 2019 20:33:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: a misunderstanding of ZAB To: user@zookeeper.apache.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 :) ben On Tue, Sep 3, 2019 at 4:52 AM Norbert Kalmar 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 a= s > 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 unt= il > a snapshot is taken), it is still the last txn that is logged by one of t= he > 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=EF=BC=9F > > if anyone helps, i will be much appreciate. > > > > > > > > 121476721@qq.com > >