From commits-return-20730-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Thu Apr 26 18:52:24 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 8E91F18077B for ; Thu, 26 Apr 2018 18:52:23 +0200 (CEST) Received: (qmail 48562 invoked by uid 500); 26 Apr 2018 16:52:22 -0000 Mailing-List: contact commits-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 commits@phoenix.apache.org Received: (qmail 48429 invoked by uid 99); 26 Apr 2018 16:52:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2018 16:52:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6BC09E965C; Thu, 26 Apr 2018 16:52:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jamestaylor@apache.org To: commits@phoenix.apache.org Date: Thu, 26 Apr 2018 16:52:24 -0000 Message-Id: <613eb4ffddaa4a16869e34aa38793aef@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/6] phoenix git commit: PHOENIX-4694 Prevent locking of parent table when dropping view to reduce contention PHOENIX-4694 Prevent locking of parent table when dropping view to reduce contention Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/2e177126 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2e177126 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2e177126 Branch: refs/heads/4.x-HBase-1.3 Commit: 2e1771261656002729b5943f2c4b2050a7bb8a1b Parents: 4b7a14c Author: James Taylor Authored: Thu Apr 19 15:09:43 2018 -0700 Committer: James Taylor Committed: Thu Apr 26 09:51:01 2018 -0700 ---------------------------------------------------------------------- .../java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/2e177126/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java index ddd3ffe..29eee7e 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java @@ -2007,8 +2007,9 @@ public class MetaDataEndpointImpl extends MetaDataProtocol implements Coprocesso } List tableNamesToDelete = Lists.newArrayList(); List sharedTablesToDelete = Lists.newArrayList(); + // No need to lock parent table for views byte[] parentTableName = MetaDataUtil.getParentTableName(tableMetadata); - byte[] lockTableName = parentTableName == null ? tableName : parentTableName; + byte[] lockTableName = parentTableName == null || tableType.equals(PTableType.VIEW.getSerializedValue()) ? tableName : parentTableName; byte[] lockKey = SchemaUtil.getTableKey(tenantIdBytes, schemaName, lockTableName); byte[] key = parentTableName == null ? lockKey : SchemaUtil.getTableKey(tenantIdBytes,