From issues-return-1169-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Fri Sep 6 15:46:17 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 1539C180645 for ; Fri, 6 Sep 2019 17:46:15 +0200 (CEST) Received: (qmail 41766 invoked by uid 500); 7 Sep 2019 03:24:31 -0000 Mailing-List: contact issues-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list issues@zookeeper.apache.org Received: (qmail 41279 invoked by uid 99); 7 Sep 2019 03:24:29 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Sep 2019 03:24:29 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id DB9F3E2FB0 for ; Fri, 6 Sep 2019 15:46:12 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 9BABC7823C0 for ; Fri, 6 Sep 2019 15:46:08 +0000 (UTC) Date: Fri, 6 Sep 2019 15:46:08 +0000 (UTC) From: "Enrico Olivelli (Jira)" To: issues@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ZOOKEEPER-3481) The problem of AcceptedEpoch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ZOOKEEPER-3481?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Enrico Olivelli updated ZOOKEEPER-3481: --------------------------------------- Fix Version/s: (was: 3.5.6) > The problem of AcceptedEpoch > ---------------------------- > > Key: ZOOKEEPER-3481 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3481 > Project: ZooKeeper > Issue Type: Improvement > Components: quorum > Affects Versions: 3.5.5 > Reporter: tom.long > Priority: Major > Fix For: 3.5.7 > > > If the leader has been elected when the voting participant joins the clus= ter, then it can only act as followers. When Leader.getEpochToPropose is ca= lled, it does not participate in the voting. However, if the AcceptedEpoch = is larger than the leader, it will never work properly.The status is as fol= lows=EF=BC=9ALOOKING -> FOLLOWING -> exception -> LOOKING. > code as follows=EF=BC=88Learner.registerWithLeader(int pktType)=EF=BC=89: > {code:java} > if (newEpoch > self.getAcceptedEpoch()){ > wrappedEpochBytes.putInt((int)self.getCurrentEpoch()); > self.setAcceptedEpoch(newEpoch);=20 > }else if (newEpoch =3D=3D self.getAcceptedEpoch()){ > // since we have already acked an epoch equal to the leaders, we canno= t ack=20 > // again, but we still need to send our lastZxid to the leader so that= we can=20 > // sync with it if it does assume leadership of the epoch.=20 > // the -1 indicates that this reply should not count as an ack for the= new epoch=20 > wrappedEpochBytes.putInt(-1);=20 > }else{=20 > throw new IOException("Leaders epoch, " + newEpoch + " is less than ac= cepted epoch, " + self.getAcceptedEpoch());=20 > } > {code} > =C2=A0 > =C2=A0 -- This message was sent by Atlassian Jira (v8.3.2#803003)