From dev-return-56777-apmail-phoenix-dev-archive=phoenix.apache.org@phoenix.apache.org Thu May 30 18:41:30 2019 Return-Path: X-Original-To: apmail-phoenix-dev-archive@minotaur.apache.org Delivered-To: apmail-phoenix-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 40750197AC for ; Thu, 30 May 2019 18:41:30 +0000 (UTC) Received: (qmail 81944 invoked by uid 500); 30 May 2019 18:41:14 -0000 Delivered-To: apmail-phoenix-dev-archive@phoenix.apache.org Received: (qmail 81272 invoked by uid 500); 30 May 2019 18:41:13 -0000 Mailing-List: contact dev-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 dev@phoenix.apache.org Received: (qmail 80897 invoked by uid 99); 30 May 2019 18:41:12 -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; Thu, 30 May 2019 18:41:12 +0000 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 87209E2CF9 for ; Thu, 30 May 2019 18:41:11 +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 0D82D245BF for ; Thu, 30 May 2019 18:41:11 +0000 (UTC) Date: Thu, 30 May 2019 18:41:11 +0000 (UTC) From: "Thomas D'Silva (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (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.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas D'Silva closed PHOENIX-5055. ----------------------------------- Bulk closing jiras for the 4.14.2 relase. > 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, 4.14.2, 5.0.1 > > Attachments: ConcurrentTest.java, PHOENIX-5055-4.x-HBase-1.4-v2.p= atch, PHOENIX-5055-4.x-HBase-1.4-v3.patch, PHOENIX-5055-4.x-HBase-1.4-v4.pa= tch, PHOENIX-5055-v4.x-HBase-1.4.patch > > > 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)