From issues-return-3295-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Mon Dec 10 20:33:04 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 DF286180627 for ; Mon, 10 Dec 2018 20:33:03 +0100 (CET) Received: (qmail 65797 invoked by uid 500); 10 Dec 2018 19:33: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 65788 invoked by uid 99); 10 Dec 2018 19:33:03 -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; Mon, 10 Dec 2018 19:33:03 +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 B67F4180C9E for ; Mon, 10 Dec 2018 19:33:02 +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 71nhAcYj4l07 for ; Mon, 10 Dec 2018 19:33:01 +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 2005F6112D for ; Mon, 10 Dec 2018 19:33: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 8C153E2072 for ; Mon, 10 Dec 2018 19:33: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 1F0B5252E2 for ; Mon, 10 Dec 2018 19:33:00 +0000 (UTC) Date: Mon, 10 Dec 2018 19:33:00 +0000 (UTC) From: "Thomas D'Silva (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= 715439#comment-16715439 ]=20 Thomas D'Silva commented on PHOENIX-5055: ----------------------------------------- [~Jaanai] In {{InQueryMoreIT}} can you update the comments since you are ch= anging the batch size. Also in MutationState.getMutationBatchList can you p= lease add a comment something like : since a single row update can contain = multiple mutations, we only check if the current batch has exceeded the row= or size limit for different rows, so that mutations for a single row don't= end up in different batches. Otherwise LGTM. > 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-4.x-HBase-1.4-v2.p= atch, PHOENIX-5055-4.x-HBase-1.4-v3.patch, PHOENIX-5055-v4.x-HBase-1.4.patc= h > > > 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. > [^ConcurrentTest.java]=C2=A0produced some random upsert/delete SQL and co= ncurrently executed, some SQL snippets as follows: > {code:java} > 1149:UPSERT INTO ConcurrentReadWritTest(A,C,E,F,G) VALUES ('3826','2563',= '3052','3170','3767'); > 1864:UPSERT INTO ConcurrentReadWritTest(A,B,C,D,E,F,G) VALUES ('2563','49= 26','3526','678',null,null,'1617'); > 2332:UPSERT INTO ConcurrentReadWritTest(A,B,C,D,E,F,G) VALUES ('1052','25= 63','1120','2314','1456',null,null); > 2846:UPSERT INTO ConcurrentReadWritTest(A,B,C,D,G) VALUES ('1922','146',n= ull,'469','2563'); > 2847:DELETE FROM ConcurrentReadWritTest WHERE A =3D '2563=E2=80=99; > {code} > Found incorrect=C2=A0indexed data for the index tables by=C2=A0sqlline. > !https://gw.alicdn.com/tfscom/TB1nSDqpxTpK1RjSZFGXXcHqFXa.png|width=3D665= ,height=3D400! > Debugged the mutations of batches on the server side. the=C2=A0DeleteColu= mns and Puts were=C2=A0splitted into the=C2=A0different batches for the onc= e upsert,=C2=A0 the DeleteFaimly also was executed by another thread.=C2=A0= due to DeleteColumns's timestamp is larger than DeleteFaimly under multipl= e threads. > !https://gw.alicdn.com/tfscom/TB1frHmpCrqK1RjSZK9XXXyypXa.png|width=3D901= ,height=3D120! > =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)