From dev-return-77773-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Wed Jan 30 15:53:45 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 03D07180652 for ; Wed, 30 Jan 2019 16:53:44 +0100 (CET) Received: (qmail 45866 invoked by uid 500); 30 Jan 2019 15:53:44 -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 45852 invoked by uid 99); 30 Jan 2019 15:53:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2019 15:53:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 787391807E5 for ; Wed, 30 Jan 2019 15:53:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 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, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id heHYQvZasWt2 for ; Wed, 30 Jan 2019 15:53:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5FB6E5FAD3 for ; Wed, 30 Jan 2019 15:30: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 C45E2E262F for ; Wed, 30 Jan 2019 15:30: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 7A19D243B6 for ; Wed, 30 Jan 2019 15:30:00 +0000 (UTC) Date: Wed, 30 Jan 2019 15:30:00 +0000 (UTC) From: "Andor Molnar (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (ZOOKEEPER-3249) Avoid reverting the cversion and pzxid during replaying txns with fuzzy snapshot 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-3249?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andor Molnar resolved ZOOKEEPER-3249. ------------------------------------- Resolution: Fixed Issue resolved by pull request 780 [https://github.com/apache/zookeeper/pull/780] > Avoid reverting the cversion and pzxid during replaying txns with fuzzy s= napshot > -------------------------------------------------------------------------= ------- > > Key: ZOOKEEPER-3249 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3249 > Project: ZooKeeper > Issue Type: Improvement > Components: server > Affects Versions: 3.6.0 > Reporter: Fangmin Lv > Assignee: Fangmin Lv > Priority: Major > Labels: pull-request-available > Fix For: 3.6.0 > > Time Spent: 20m > Remaining Estimate: 0h > > The only case we need to have [the tricky hack code|https://github.com/ap= ache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookee= per/server/DataTree.java#L1036-L1065] , is because of the scenario below: > If the child is deleted due to session close and re-created in a differen= t global session after that the parent is serialized, then when replay the = txn because the node is belonging to a different session, replay the closeS= ession txn won't delete it anymore, and we'll get NODEEXISTS error when rep= lay the createNode txn. In this case, we need to update the cversion and pz= xid to the new value with this tricky code here. > This could be solved in ZOOKEEPER-3145 with explicit CloseSessionTxn. In = theory, with that code, we don't need this kind of hack code anymore, but t= here is another case, which could cause the cversion and pzxid being revert= ed, and we still need to patch it, here is the scenario: > 1. Start to take snapshot at T0 > 2. Txn T1 create /P/N1, set P's cversion and pzxid to (1, 1) > 3. Txn T2 create /P/N2, set P's cversion and pzxid to (2, 2) > 4. Txn T3 delete /P/N1, set P's pzxid to 3, which is (2, 3) > Those state are in the fuzzy snapshot. > When loading the snapshot and txns during start up based on the current c= ode: > 1. replay T1, since /P/N1 is not exist, we'll overwrite P's cversion and = pzxid to (1, 1) > 2. replay T2, node already exist, so go through the hack code to patch cv= ersion and pzxid, and it became (2, 2) > 3. replay T3, set P's pzxid to 3, which is now (2, 3) > The state is consistent with the tricky patch code, but it's error-prone = and hacky, we should remove that. To be able to remove that, in this patch,= we're going to check the cversion first and avoid reverting the cversion a= nd pzxid when replaying txns. > We've also added metrics to verify=C2=A0that logic is not active=C2=A0on = prod anymore, after that I'll open another Jira to remove it to make the lo= gic cleaner. -- This message was sent by Atlassian JIRA (v7.6.3#76005)