From dev-return-50079-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Mon Mar 12 16:56:06 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 4924418067B for ; Mon, 12 Mar 2018 16:56:06 +0100 (CET) Received: (qmail 6684 invoked by uid 500); 12 Mar 2018 15:56:05 -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 6385 invoked by uid 99); 12 Mar 2018 15:56:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Mar 2018 15:56:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 84CB61A0907 for ; Mon, 12 Mar 2018 15:56:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id QnxYfat_ml4B for ; Mon, 12 Mar 2018 15:56:03 +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 49DAC5F5C6 for ; Mon, 12 Mar 2018 15:56:03 +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 5630FE021F for ; Mon, 12 Mar 2018 15:56:02 +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 C9D8421477 for ; Mon, 12 Mar 2018 15:56:00 +0000 (UTC) Date: Mon, 12 Mar 2018 15:56:00 +0000 (UTC) From: "Ohad Shacham (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4641) Perform index maintenance on server-side for transactional local indexes 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-4641?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 395424#comment-16395424 ]=20 Ohad Shacham commented on PHOENIX-4641: --------------------------------------- FYI [~jamestaylor]. I=C2=A0created OMID-93, will create a pull request tomo= rrow. > Perform index maintenance on server-side for transactional local indexes > ------------------------------------------------------------------------ > > Key: PHOENIX-4641 > URL: https://issues.apache.org/jira/browse/PHOENIX-4641 > Project: Phoenix > Issue Type: Bug > Reporter: James Taylor > Priority: Major > > PHOENIX-4278 changed index maintenance for transactional tables to be per= formed on the client side. For local indexes, this is not ideal and not rea= lly necessary as the updates to the indexes will all be local. By doing thi= s on the client side, we'd incur extra overhead: > - extra RPCs for updates to local index tables separate from RPCs for dat= a tables > - related to this, more network bandwidth would be used > - calculation on client-side to determine region start key (which is some= one unclear whether there's a race condition with a split occurring while t= his is being determined) > - the updates to local indexes would no longer be row-level atomic with d= ata table HBase updates (though they'd be atomic because they're transactio= nal) > With Tephra, we can do the index maintenance on the server side without f= urther changes. For Omid, it's more difficult since we must: > - perform all writes > - write to the commit table > - write the shadow cells (which requires knowing the index updates) > If there will already be an API to write the shadow cells (required for t= he initial population of local indexes), then perhaps we could piggyback on= that. On the client-side, we could do the following: > - perform all writes > - write to the commit table > - perform writes again, but with a flag set to indicate that only the sha= dow cells need to be written (note we already have the mutation.setAttribut= e(REPLAY_WRITES, REPLAY_ONLY_INDEX_WRITES) option that will help with this)= . In this case, we'd execute the logic to compute the index updates twice,= but on the plus side, we wouldn't incur the other overhead mentioned befor= e. > All in all, it's unclear if this is worth doing. It doesn't make a lot of= sense to use local indexes for transactional tables, since one of the bigg= est benefits of local indexes is row level atomicity between index and tabl= e rows is already achieved more generally by transactions. -- This message was sent by Atlassian JIRA (v7.6.3#76005)