Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5F3C0200BB6 for ; Fri, 4 Nov 2016 20:52:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5DBD2160AEA; Fri, 4 Nov 2016 19:52:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A2474160B04 for ; Fri, 4 Nov 2016 20:51:59 +0100 (CET) Received: (qmail 68120 invoked by uid 500); 4 Nov 2016 19:51:58 -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 67784 invoked by uid 99); 4 Nov 2016 19:51:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2016 19:51:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 61CDF2C1F54 for ; Fri, 4 Nov 2016 19:51:58 +0000 (UTC) Date: Fri, 4 Nov 2016 19:51:58 +0000 (UTC) From: "Hudson (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-3199) ServerCacheClient sends cache to all regions unnecessarily MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 04 Nov 2016 19:52:00 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15637479#comment-15637479 ] Hudson commented on PHOENIX-3199: --------------------------------- FAILURE: Integrated in Jenkins build Phoenix-master #1473 (See [https://builds.apache.org/job/Phoenix-master/1473/]) PHOENIX-3199 ServerCacheClient sends cache to all regions unnecessarily (jamestaylor: rev e4e1570b83ca0141fc19421a0bd5217ebb37f512) * (edit) phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java > ServerCacheClient sends cache to all regions unnecessarily > ---------------------------------------------------------- > > Key: PHOENIX-3199 > URL: https://issues.apache.org/jira/browse/PHOENIX-3199 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.8.0 > Reporter: chenglei > Assignee: chenglei > Fix For: 4.10.0, 4.8.2 > > Attachments: PHOENIX-3199_v8.patch, PHOENIX-3199_v9.patch > > > The issue is caused by the htable's coprocessorService method,the third parameter endKey is inclusive,not exclusive.When both startKey and endKey are HConstants.EMPTY_START_ROW,the coprocessorService method may send callable to all regions: > {code:borderStyle=solid} > coprocessorService(final Class service,byte[] startKey, byte[] endKey, final Batch.Call callable) > {code} > In the addServerCache method of org.apache.phoenix.cache.ServerCacheClient class, once the first region can pass the if test in line 174, because the startKey of the first region is HConstants.EMPTY_START_ROW, so the key is also HConstants.EMPTY_START_ROW in line 180. When we invoke the htable's coprocessorService method in line 189, the startKey and endKey(Inclusive) parameters are both HConstants.EMPTY_START_ROW,and the htable's coprocessorService method internally uses getKeysAndRegionsInRange method to locate > [HConstants.EMPTY_START_ROW,HConstants.EMPTY_START_ROW] to all regions, so cache would be sent to all regions : > {code:borderStyle=solid} > 170 for (HRegionLocation entry : locations) { > 171 // Keep track of servers we've sent to and only send once > 172 byte[] regionStartKey = entry.getRegionInfo().getStartKey(); > 173 byte[] regionEndKey = entry.getRegionInfo().getEndKey(); > 174 if ( ! servers.contains(entry) && > 175 keyRanges.intersectRegion(regionStartKey, regionEndKey, > 176 cacheUsingTable.getIndexType() == IndexType.LOCAL)) { > 177 // Call RPC once per server > 178 servers.add(entry); > 179 if (LOG.isDebugEnabled()) {LOG.debug(addCustomAnnotations("Adding cache entry to be sent for " + entry, connection));} > 180 final byte[] key = entry.getRegionInfo().getStartKey(); > 181 final HTableInterface htable = services.getTable(cacheUsingTableRef.getTable().getPhysicalName().getBytes()); > 182 closeables.add(htable); > 183 futures.add(executor.submit(new JobCallable() { > 184 > 185 @Override > 186 public Boolean call() throws Exception { > 187 final Map results; > 188 try { > 189 results = htable.coprocessorService(ServerCachingService.class, key, key, > 190 new Batch.Call() { > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)