From issues-return-3146-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Tue Dec 4 01:45:05 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 C14ED18067E for ; Tue, 4 Dec 2018 01:45:04 +0100 (CET) Received: (qmail 37313 invoked by uid 500); 4 Dec 2018 00:45:03 -0000 Mailing-List: contact issues-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list issues@phoenix.apache.org Received: (qmail 37304 invoked by uid 99); 4 Dec 2018 00:45: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; Tue, 04 Dec 2018 00:45: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 72AFDC0413 for ; Tue, 4 Dec 2018 00:45:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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-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 hELVh_vjCG-t for ; Tue, 4 Dec 2018 00:45:02 +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 9714C5F5BA for ; Tue, 4 Dec 2018 00:45: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 BAD90E0E87 for ; Tue, 4 Dec 2018 00:45: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 39A6824DD8 for ; Tue, 4 Dec 2018 00:45:00 +0000 (UTC) Date: Tue, 4 Dec 2018 00:45:00 +0000 (UTC) From: "Vincent Poon (JIRA)" To: issues@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-5055) Split mutations batches probably affects correctness of index data 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/PHOENIX-5055?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 708026#comment-16708026 ]=20 Vincent Poon commented on PHOENIX-5055: --------------------------------------- Nice find [~Jaanai], the problem makes sense. But how do you get an out of= sync index from this? I tried setting my phoenix.mutate.batchSize to 1 on sqlline, and I can get = the different timestamp on the DeleteColumn, but couldn't come up with a se= quence of writes that would make the index out of sync... > Split mutations batches probably affects correctness of index data > ------------------------------------------------------------------ > > Key: PHOENIX-5055 > URL: https://issues.apache.org/jira/browse/PHOENIX-5055 > Project: Phoenix > Issue Type: Bug > Affects Versions: 5.0.0, 4.14.1 > Reporter: Jaanai > Assignee: Jaanai > Priority: Critical > Fix For: 5.1.0 > > Attachments: ConcurrentTest.java, PHOENIX-5055-v4.x-HBase-1.4.pat= ch > > > In order to get more performance, we split the list of mutations=C2=A0int= o multiple batches in MutationSate.=C2=A0 For one upsert SQL with some null= values that will produce two type KeyValues(Put and DeleteColumn),=C2=A0 T= hese KeyValues should have the=C2=A0same timestamp so that keep on an atomi= c operation for corresponding the row key. > =C2=A0Found incorrect=C2=A0indexed data for the index tables by=C2=A0sqll= ine. > !https://gw.alicdn.com/tfscom/TB1nSDqpxTpK1RjSZFGXXcHqFXa.png|width=3D665= ,height=3D400! > =C2=A0 > Running the following: > {code:java} > conn.createStatement().executeUpdate( "CREATE TABLE " + tableName + " (" = + "A VARCHAR NOT NULL PRIMARY KEY," + "B VARCHAR," + "C VARCHAR," + "D VARC= HAR) COLUMN_ENCODED_BYTES =3D 0");=20 > conn.createStatement().executeUpdate("CREATE INDEX " + indexName + " on "= + tableName + " (C) INCLUDE(D)");=20 > conn.createStatement().executeUpdate("UPSERT INTO " + tableName + "(A,B,C= ,D) VALUES ('A2','B2','C2','D2')");=20 > conn.createStatement().executeUpdate("UPSERT INTO " + tableName + "(A,B,C= ,D) VALUES ('A3','B3', 'C3', null)"); > {code} > dump IndexMemStore: > {code:java} > hbase.index.covered.data.IndexMemStore(117): Inserting:\x01A3/0:D/1542190= 446218/DeleteColumn/vlen=3D0/seqid=3D0/value=3D phoenix.hbase.index.covered= .data.IndexMemStore(133): Current kv state: phoenix.hbase.index.covered.dat= a.IndexMemStore(135): KV: \x01A3/0:B/1542190446167/Put/vlen=3D2/seqid=3D5/v= alue=3DB3 phoenix.hbase.index.covered.data.IndexMemStore(135): KV: \x01A3/0= :C/1542190446167/Put/vlen=3D2/seqid=3D5/value=3DC3 phoenix.hbase.index.cove= red.data.IndexMemStore(135): KV: \x01A3/0:D/1542190446218/DeleteColumn/vlen= =3D0/seqid=3D0/value=3D phoenix.hbase.index.covered.data.IndexMemStore(135)= : KV: \x01A3/0:_0/1542190446167/Put/vlen=3D1/seqid=3D5/value=3Dx phoenix.hb= ase.index.covered.data.IndexMemStore(137): =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D E= ND MemStore Dump =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > {code} > =C2=A0 > The=C2=A0DeleteColumn's=C2=A0timestamp larger than other mutations. > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)