From dev-return-67386-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Fri Feb 9 19:47:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 85913180654 for ; Fri, 9 Feb 2018 19:47:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 75495160C5F; Fri, 9 Feb 2018 18:47:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BA8C4160C3C for ; Fri, 9 Feb 2018 19:47:04 +0100 (CET) Received: (qmail 84034 invoked by uid 500); 9 Feb 2018 18:47:03 -0000 Mailing-List: contact dev-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 dev@zookeeper.apache.org Received: (qmail 84022 invoked by uid 99); 9 Feb 2018 18:47:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2018 18:47:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1EDAFC00E0 for ; Fri, 9 Feb 2018 18:47:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id SUiTi54KE_Zo for ; Fri, 9 Feb 2018 18:47:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4C3EC5F1A1 for ; Fri, 9 Feb 2018 18:47:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 93209E0153 for ; Fri, 9 Feb 2018 18:47:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4ED1821E84 for ; Fri, 9 Feb 2018 18:47:00 +0000 (UTC) Date: Fri, 9 Feb 2018 18:47:00 +0000 (UTC) From: "Fangmin Lv (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-2845) Data inconsistency issue due to retain database in leader election 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-2845?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 16358804#comment-16358804 ]=20 Fangmin Lv commented on ZOOKEEPER-2845: --------------------------------------- [~revans2] the txn will only be applied to DB when it's quorum committed, t= he problem here is not=C2=A0lost a txn but with an extra txn which is not q= uorum committed, and it's what shown in the=C2=A0Jira description. > Data inconsistency issue due to retain database in leader election > ------------------------------------------------------------------ > > Key: ZOOKEEPER-2845 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2845 > Project: ZooKeeper > Issue Type: Bug > Components: quorum > Affects Versions: 3.4.10, 3.5.3, 3.6.0 > Reporter: Fangmin Lv > Assignee: Robert Joseph Evans > Priority: Critical > > In ZOOKEEPER-2678, the ZKDatabase is retained to reduce the unavailable t= ime during leader election. In ZooKeeper ensemble, it's possible that the s= napshot is ahead of txn file (due to slow disk on the server, etc), or the = txn file is ahead of snapshot due to no commit message being received yet.= =20 > If snapshot is ahead of txn file, since the SyncRequestProcessor queue wi= ll be drained during shutdown, the snapshot and txn file will keep consiste= nt before leader election happening, so this is not an issue. > But if txn is ahead of snapshot, it's possible that the ensemble will hav= e data inconsistent issue, here is the simplified scenario to show the issu= e: > Let's say we have a 3 servers in the ensemble, server A and B are followe= rs, and C is leader, and all the snapshot and txn are up to T0: > 1. A new request reached to leader C to create Node N, and it's converted= to txn T1=20 > 2. Txn T1 was synced to disk in C, but just before the proposal reaching = out to the followers, A and B restarted, so the T1 didn't exist in A and B > 3. A and B formed a new quorum after restart, let's say B is the leader > 4. C changed to looking state due to no enough followers, it will sync wi= th leader B with last Zxid T0, which will have an empty diff sync > 5. Before C take snapshot it restarted, it replayed the txns on disk whic= h includes T1, now it will have Node N, but A and B doesn't have it. > Also I included the a test case to reproduce this issue consistently.=20 > We have a totally different RetainDB version which will avoid this issue = by doing consensus between snapshot and txn files before leader election, w= ill submit for review. -- This message was sent by Atlassian JIRA (v7.6.3#76005)