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 32781200B59 for ; Mon, 8 Aug 2016 08:41:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2D209160A91; Mon, 8 Aug 2016 06:41:22 +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 74DF0160A8F for ; Mon, 8 Aug 2016 08:41:21 +0200 (CEST) Received: (qmail 52351 invoked by uid 500); 8 Aug 2016 06:41:20 -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 52335 invoked by uid 99); 8 Aug 2016 06:41:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2016 06:41:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6A4052C027F for ; Mon, 8 Aug 2016 06:41:20 +0000 (UTC) Date: Mon, 8 Aug 2016 06:41:20 +0000 (UTC) From: "Devaraj Das (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-3159) CachingHTableFactory may close HTable during eviction even if it is getting used for writing by another thread. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 08 Aug 2016 06:41:22 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15411400#comment-15411400 ] Devaraj Das commented on PHOENIX-3159: -------------------------------------- [~ankit@apache.org] thanks. I missed one thing though - the operation of adding/removing entries in/from the workingTables should be synchronized as well on the workingTables. Otherwise, it might race with the contains() check (you could have inserted a 'table' in the workingTables just after the workingTables.contains() check - the table will be closed although the table should remain open). > CachingHTableFactory may close HTable during eviction even if it is getting used for writing by another thread. > --------------------------------------------------------------------------------------------------------------- > > Key: PHOENIX-3159 > URL: https://issues.apache.org/jira/browse/PHOENIX-3159 > Project: Phoenix > Issue Type: Bug > Reporter: Ankit Singhal > Assignee: Ankit Singhal > Fix For: 4.8.1 > > Attachments: PHOENIX-3159.patch > > > CachingHTableFactory may close HTable during eviction even if it is getting used for writing by another thread which results in writing thread to fail and index is disabled. > LRU eviction closing HTable or underlying connection when cache is full and new HTable is requested. > {code} > 2016-08-04 13:45:21,109 DEBUG [nat-s11-4-ioss-phoenix-1-5.openstacklocal,16020,1470297472814-index-writer--pool11-t35] client.ConnectionManager$HConnectionImplementation: Closing HConnection (debugging purposes only) > java.lang.Exception > at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.internalClose(ConnectionManager.java:2423) > at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.close(ConnectionManager.java:2447) > at org.apache.hadoop.hbase.client.CoprocessorHConnection.close(CoprocessorHConnection.java:41) > at org.apache.hadoop.hbase.client.HTableWrapper.internalClose(HTableWrapper.java:91) > at org.apache.hadoop.hbase.client.HTableWrapper.close(HTableWrapper.java:107) > at org.apache.phoenix.hbase.index.table.CachingHTableFactory$HTableInterfaceLRUMap.removeLRU(CachingHTableFactory.java:61) > at org.apache.commons.collections.map.LRUMap.addMapping(LRUMap.java:256) > at org.apache.commons.collections.map.AbstractHashedMap.put(AbstractHashedMap.java:284) > at org.apache.phoenix.hbase.index.table.CachingHTableFactory.getTable(CachingHTableFactory.java:100) > at org.apache.phoenix.hbase.index.write.ParallelWriterIndexCommitter$1.call(ParallelWriterIndexCommitter.java:160) > at org.apache.phoenix.hbase.index.write.ParallelWriterIndexCommitter$1.call(ParallelWriterIndexCommitter.java:136) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > {code} > But the IndexWriter was using this old connection to write to the table which was closed during LRU eviction > {code} > 016-08-04 13:44:59,553 ERROR [htable-pool659-t1] client.AsyncProcess: Cannot get replica 0 location for {"totalColumns":1,"row":"\\xC7\\x03\\x04\\x06X\\x1C)\\x00\\x80\\x07\\xB0X","families":{"0":[{"qualifier":"_0","vlen":2,"tag":[],"timestamp":1470318296425}]}} > java.io.IOException: hconnection-0x21f468be closed > at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1153) > at org.apache.hadoop.hbase.client.CoprocessorHConnection.locateRegion(CoprocessorHConnection.java:41) > at org.apache.hadoop.hbase.client.AsyncProcess$AsyncRequestFutureImpl.findAllLocationsOrFail(AsyncProcess.java:949) > at org.apache.hadoop.hbase.client.AsyncProcess$AsyncRequestFutureImpl.groupAndSendMultiAction(AsyncProcess.java:866) > at org.apache.hadoop.hbase.client.AsyncProcess$AsyncRequestFutureImpl.resubmit(AsyncProcess.java:1195) > at org.apache.hadoop.hbase.client.AsyncProcess$AsyncRequestFutureImpl.receiveGlobalFailure(AsyncProcess.java:1162) > at org.apache.hadoop.hbase.client.AsyncProcess$AsyncRequestFutureImpl.access$1100(AsyncProcess.java:584) > at org.apache.hadoop.hbase.client.AsyncProcess$AsyncRequestFutureImpl$SingleServerRequestRunnable.run(AsyncProcess.java:727) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > {code} > Although the workaround is to the cache size(index.tablefactory.cache.size). But still we should handle the closing of working HTables to avoid index write failures (which in turn disables index). -- This message was sent by Atlassian JIRA (v6.3.4#6332)