Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AF4E67814 for ; Tue, 9 Aug 2011 05:55:07 +0000 (UTC) Received: (qmail 87533 invoked by uid 500); 9 Aug 2011 05:55:06 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 87352 invoked by uid 500); 9 Aug 2011 05:54:54 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 87336 invoked by uid 99); 9 Aug 2011 05:54:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2011 05:54:51 +0000 X-ASF-Spam-Status: No, hits=-2000.8 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2011 05:54:49 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id F167EB36C4 for ; Tue, 9 Aug 2011 05:54:28 +0000 (UTC) Date: Tue, 9 Aug 2011 05:54:28 +0000 (UTC) From: "jiraposter@reviews.apache.org (JIRA)" To: issues@hbase.apache.org Message-ID: <484735764.19127.1312869268985.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1880808198.18754.1312858347676.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HBASE-4181) HConnectionManager can't find cached HRegionInterface makes client very slow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-4181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13081456#comment-13081456 ] jiraposter@reviews.apache.org commented on HBASE-4181: ------------------------------------------------------ ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1402/ ----------------------------------------------------------- (Updated 2011-08-09 05:53:25.766068) Review request for hbase. Summary (updated) ------- HConnectionManager can't find cached HRegionInterface makes client very slow Addressing.createHostAndPortStr(hostname, port); //the Addressing created a address like "node41:60010" ...... this.servers.put(address.toString(), server); //but here address.toString() send an address like "node41/10.61.2l.171:60010 This addresses bug HBase-4181. https://issues.apache.org/jira/browse/HBase-4181 Diffs ----- http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java 1155206 Diff: https://reviews.apache.org/r/1402/diff Testing ------- Tests passed locally. Thanks, Jia > HConnectionManager can't find cached HRegionInterface makes client very slow > ---------------------------------------------------------------------------- > > Key: HBASE-4181 > URL: https://issues.apache.org/jira/browse/HBASE-4181 > Project: HBase > Issue Type: Bug > Components: client > Affects Versions: 0.90.4, 0.92.0 > Reporter: Liu Jia > Priority: Critical > Labels: HConnectionManager > Attachments: HConnectionManager.patch > > > HRegionInterface getHRegionConnection(final String hostname, > final int port, final InetSocketAddress isa, final boolean master) > throws IOException > ///////////////////////// > String rsName = isa != null ? isa.toString() : Addressing > .createHostAndPortStr(hostname, port); > > ////here,if isa is null, the Addressing created a address like "node41:60010" > ////should use "isa.toString():new InetSocketAddress(hostname, port).toString();" > ////instead of "Addressing.createHostAndPortStr(hostname, port);" > server = this.servers.get(rsName); > if (server == null) { > // create a unique lock for this RS (if necessary) > this.connectionLock.putIfAbsent(rsName, rsName); > // get the RS lock > synchronized (this.connectionLock.get(rsName)) { > // do one more lookup in case we were stalled above > server = this.servers.get(rsName); > if (server == null) { > try { > if (clusterId.hasId()) { > conf.set(HConstants.CLUSTER_ID, clusterId.getId()); > } > // Only create isa when we need to. > InetSocketAddress address = isa != null ? isa > : new InetSocketAddress(hostname, port); > // definitely a cache miss. establish an RPC for this RS > server = (HRegionInterface) HBaseRPC.waitForProxy( > serverInterfaceClass, HRegionInterface.VERSION, address, > this.conf, this.maxRPCAttempts, this.rpcTimeout, > this.rpcTimeout); > this.servers.put(address.toString(), server); > > ////but here address.toString() send an address like "node41/10.61.2l.171:60010 > ////so this method can never get cached address and make client request very slow due to it's synchronized. > > > } catch (RemoteException e) { > LOG.warn("RemoteException connecting to RS", e); > // Throw what the RemoteException was carrying. > throw RemoteExceptionHandler.decodeRemoteException(e); > } > } > } > /////////////////////// -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira