hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Hofhansl (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-8698) potential thread creation in MetaScanner.metaScan
Date Thu, 06 Jun 2013 21:54:21 GMT

    [ https://issues.apache.org/jira/browse/HBASE-8698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13677565#comment-13677565
] 

Lars Hofhansl commented on HBASE-8698:
--------------------------------------

And this (also from Kireet):
Also, I was looking at the stack below. From my reading of the code, the
HTable.batch() call will always cause the prefetch call to occur, which
will cause a new HTable object to get created. The constructor used in
creating a new thread pool. So every call to batch will create a new
thread? Or the HTable's thread pool never gets used as the pool is only
used for writes? I think I am missing something but just want to confirm.

{code}
java.lang.Thread.State: WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  at java.lang.Object.wait(Object.java:503)
  at org.apache.zookeeper.ClientCnxn.submitRequest(ClientCnxn.java:1309)
- locked <0x00000000e10cf830> (a org.apache.zookeeper.ClientCnxn$Packet)
  at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1036)
  at
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:172)
  at org.apache.hadoop.hbase.zookeeper.ZKUtil.checkExists(ZKUtil.java:450)
  at
org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.checkIfBaseNodeAvailable(ZooKeeperNodeTracker.java:208)
  at
org.apache.hadoop.hbase.zookeeper.RootRegionTracker.waitRootRegionLocation(RootRegionTracker.java:77)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:874)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:987)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:885)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:846)
  at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:234)
  at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:174)
  at
org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:160)
  at
org.apache.hadoop.hbase.client.MetaScanner.access$000(MetaScanner.java:54)
  at
org.apache.hadoop.hbase.client.MetaScanner$1.connect(MetaScanner.java:133)
  at
org.apache.hadoop.hbase.client.MetaScanner$1.connect(MetaScanner.java:130)
  at
org.apache.hadoop.hbase.client.HConnectionManager.execute(HConnectionManager.java:383)
  at
org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:130)
  at
org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:105)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.prefetchRegionCache(HConnectionManager.java:947)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:1002)
- locked <0x00000000e882f778> (a java.lang.Object)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:889)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:846)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatchCallback(HConnectionManager.java:1533)
  at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1418)
  at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:702)
  at org.apache.hadoop.hbase.client.HTable.get(HTable.java:671)
  at
org.apache.hadoop.hbase.client.HTablePool$PooledHTable.get(HTablePool.java:367)
{code}
                
> potential thread creation in MetaScanner.metaScan
> -------------------------------------------------
>
>                 Key: HBASE-8698
>                 URL: https://issues.apache.org/jira/browse/HBASE-8698
>             Project: HBase
>          Issue Type: Bug
>          Components: Client
>    Affects Versions: 0.94.7
>            Reporter: Kireet Reddy
>
> MetaScanner.metaScan() creates an instance of HTable per call. The constructur used creates
a new ThreadPoolExecutor. The executor itself will not create a thread unless it's pool is
used. I am not sure if the HTable instance in question ever uses it's pool. But if so, this
could become a big performance issue. Logging an issue at Lars's request. mail list chain
below.
> ------------------------------------- 
> Indeed. That is bad.
> I cannot see a clean fix immediately, but we need to look at this.
> Mind filing a ticket, Kireet?
> -- Lars
> ________________________________
>  From: Kireet <kireet-Teh5dPVPL8nQT0dZR+AlfA@public.gmane.org>
> To: public-user-50Pas4EWwPEyzMRdD/IqWQ-wOFGN7rlS/M9smdsby/KFg@public.gmane.org 
> Sent: Friday, May 31, 2013 11:58 AM
> Subject: Re: HConnectionManager$HConnectionImplementation.locateRegionInMeta
>  
> Even if I initiate the call via a pooled htable, the MetaScanner seems 
> to use a concrete HTable instance. The constructor invoked seems to 
> create a java ThreadPoolExecutor. I am not 100% sure but I think as long 
> as nothing is submitted to the ThreadPoolExecutor it won't create any 
> threads. I just wanted to confirm this was the case. I do see the 
> connection is shared.
> --Kireet
> On 5/30/13 7:38 PM, Ted Yu wrote:
> > HTablePool$**PooledHTable is a wrapper around HTable.
> >
> > Here is how HTable obtains a connection:
> >
> >     public HTable(Configuration conf, final byte[] tableName, final
> > ExecutorService pool)
> >         throws IOException {
> >       this.connection = HConnectionManager.getConnection(conf);
> >
> > Meaning the connection is a shared one based on certain key/value pairs
> > from conf.
> >
> > bq. So every call to batch will create a new thread?
> >
> > I don't think so.
> >
> > On Thu, May 30, 2013 at 11:28 AM, Kireet <kireet-Teh5dPVPL8nQT0dZR+AlfA-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
wrote:
> >
> >>
> >>
> >> Thanks, will give it a shot. So I should download 0.94.7 (latest stable)
> >> and run the patch tool on top with the backport? This is a little new to me.
> >>
> >> Also, I was looking at the stack below. From my reading of the code, the
> >> HTable.batch() call will always cause the prefetch call to occur, which
> >> will cause a new HTable object to get created. The constructor used in
> >> creating a new thread pool. So every call to batch will create a new
> >> thread? Or the HTable's thread pool never gets used as the pool is only
> >> used for writes? I think I am missing something but just want to confirm.
> >>
> >> Thanks
> >> Kireet

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message