From user-return-11500-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Thu Jun 14 06:58:18 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8864B180600 for ; Thu, 14 Jun 2018 06:58:17 +0200 (CEST) Received: (qmail 93293 invoked by uid 500); 14 Jun 2018 04:58:16 -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 93281 invoked by uid 99); 14 Jun 2018 04:58:15 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2018 04:58:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6D15EC135E for ; Thu, 14 Jun 2018 04:51:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.129 X-Spam-Level: ** X-Spam-Status: No, score=2.129 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id aqZWxmn6JpfO for ; Thu, 14 Jun 2018 04:51:05 +0000 (UTC) Received: from mail-ua0-f196.google.com (mail-ua0-f196.google.com [209.85.217.196]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 21BB15F33D for ; Thu, 14 Jun 2018 04:51:05 +0000 (UTC) Received: by mail-ua0-f196.google.com with SMTP id i3-v6so3252641uad.4 for ; Wed, 13 Jun 2018 21:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=hyzBQ+czGptiipjn8TkeeNfserhjWnolHI2MBhnnAtk=; b=HtIyJf54gIxJo3TkevkmXVBKEkxzX3D8bw4dD/fpnjVzpqq/RKYIYnhvQeeFjsljo/ FtKab4gURAoByJWVWyHLlKMStIyO1kIIfwYg/r/eI3/q6HTEP0Rgubk5Q21SuxEHMDTS Mm8xSroYvjT+4DzhMxBxW/fcAzw4GPLFmq6tDi+bEeZdsaHZ+h137EICTugHj2uCJLRQ 8dv9xiIg9mRg9Npw/52BhS9gWbBA9dTPtrqdzO43E5NGSTTAPnopqVcWLCWYWezPQYHx ZTOu4sQUpL2ALRkMduarvLGCC1MnnWRIx82F80/iNgmavFwUj/kE8q20yHy/OUybm+c7 dOCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=hyzBQ+czGptiipjn8TkeeNfserhjWnolHI2MBhnnAtk=; b=CXrGTuP3oqWguxGwB19oi4f4upRZK5XUeVie8XbLSby9Mn2aY6mvOadbkY53olPZT6 5EyITNtvFVXqtwLyniBNAFX9M5peYZIK97wj2QFAYK8M9CzN/cHNdzMClJKyy8jOQg/k mlEEl0wkIshgb/rQaqfJ6PNMX1rKnupL4wTis/MgS7Wd3FmMAsTR4G7YyyRmu/2aib1f AljXHhmiQByfiPFvBupzSrMSJSJzC3Ri4JvP4xKRBElmGPprJ3HCVrjaGaI0v3Lw1r3z eZqR0wvD1rwO+3OdpIo9TkQOuRlVRV5hR8NSLjPBJ0hCIH2qqTH543WeIc8V2Zbq6iLA eI8A== X-Gm-Message-State: APt69E3usb+0p3z+s9QMTy8b7saf6BfiCutB7HhYMn93exmvJzvXBhit /TJmA2kJJuyJQfGHomnNw5dFWvqhMO80wIgTj48= X-Google-Smtp-Source: ADUXVKKbOZ5AlGbBhJh5xneWf4E3EU2KZfFA9C5dHrZWr1SP2ojNnvynjqRnrvGYUfY/bs4zE7Gy+wZW2YEIy04IXjE= X-Received: by 2002:a9f:2007:: with SMTP id 7-v6mr691724uam.16.1528951864421; Wed, 13 Jun 2018 21:51:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: yuzhou li Date: Thu, 14 Jun 2018 12:50:55 +0800 Message-ID: Subject: Re: what's the different between acceptedEpoch and currentEpoch? To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary="000000000000c1f416056e92d882" --000000000000c1f416056e92d882 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you very much! Michael Han =E4=BA=8E2018=E5=B9=B46=E6=9C=8811=E6=97=A5= =E5=91=A8=E4=B8=80 =E4=B8=8B=E5=8D=882:04=E5=86=99=E9=81=93=EF=BC=9A > The two variables serve different purposes. acceptedEpoch stores the epoc= h > of the last NEWEPOCH message received and currentEpoch stores the epoch o= f > the last NEWLEADER message received. They were introduced in ZOOKEEPER-33= 5, > 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 epo= ch > (currentEpoch) after leader election to solve what's reported in ZK-335. > > On Sun, Jun 10, 2018 at 1:18 AM, yuzhou li 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 epo= ch > > acceptedEpoch and currentEpoch. But I don't understand why acceptEpoch = is > > needed instead of using currentEpoch directly? > > > --000000000000c1f416056e92d882--