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 C23396DAE for ; Fri, 20 May 2011 23:48:28 +0000 (UTC) Received: (qmail 41579 invoked by uid 500); 20 May 2011 23:48:28 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 41550 invoked by uid 500); 20 May 2011 23:48:28 -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 41542 invoked by uid 99); 20 May 2011 23:48:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2011 23:48:28 +0000 X-ASF-Spam-Status: No, hits=-1998.7 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD,URI_HEX 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; Fri, 20 May 2011 23:48:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 68446D43AC for ; Fri, 20 May 2011 23:47:47 +0000 (UTC) Date: Fri, 20 May 2011 23:47:47 +0000 (UTC) From: "Vidhyashankar Venkataraman (JIRA)" To: issues@hbase.apache.org Message-ID: <632275656.32267.1305935267423.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1117294639.28818.1305845387414.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HBASE-3904) HConnection.isTableAvailable returns true even with not all regions available. 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-3904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037163#comment-13037163 ] Vidhyashankar Venkataraman commented on HBASE-3904: --------------------------------------------------- Ok, I tested your patch with the code attached below: And I get the following output: Caught Socket timeout.. Mostly caused by a slow region assignment by master! 11/05/20 23:26:00 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=b3110640.yst.yahoo.net:44481,b3110600.yst.yahoo.net:44481,b3110560.yst.yahoo.net:44481,b3110520.yst.yahoo.net:44481,b3110680.yst.yahoo.net:44481 sessionTimeout=180000 watcher=hconnection 11/05/20 23:26:00 INFO zookeeper.ClientCnxn: Opening socket connection to server b3110560.yst.yahoo.net/67.195.55.234:44481 11/05/20 23:26:00 INFO zookeeper.ClientCnxn: Socket connection established to b3110560.yst.yahoo.net/67.195.55.234:44481, initiating session 11/05/20 23:26:00 INFO zookeeper.ClientCnxn: Session establishment complete on server b3110560.yst.yahoo.net/67.195.55.234:44481, sessionid = 0x12ff6d3911179e8, negotiated timeout = 180000 Table test-v6 not yet available... Sleeping for 5 more minutes... Expected #regions = 17933 Table is probably available!! : test-v6 Available? true Table test-v6 may not be available... Double checking: Sleeping for 5 minutes more... Table test-v6: Expected # Regions = 17933 Actual number = 4744 Table test-v6 may not be available... Double checking: Sleeping for 5 minutes more... And it is still trying to assign. 1. The good: Notice that tableAvailable got out of the loop because it was true and it also printed true in the following print message. This has never happened without the patch. 2. The doubtful part: isTableAvailable still doesn't return back when all regions are online as we see in the subsequent output. Can you let me know what your patch intended to do? Thank you Vidhya THE CODE: try { hbAdmin.createTableAsync(htd, keysArray.toArray(new byte[0][0])); } catch (java.net.SocketTimeoutException e) { System.err.println("Caught Socket timeout.. " + "Mostly caused by a slow region assignment by master!"); } HTable table = new HTable(tableName); HConnection conn = table.getConnection(); do { System.out.println("Table " + tableName + "not yet available... " + "Sleeping for 5 more minutes... Expected #regions = " + (keysArray.size()+1)); Thread.sleep(300000); } while (!conn.isTableAvailable(table.getTableName())); System.err.println("Table is probably available!! : " + tableName + " Available? " + conn.isTableAvailable(table.getTableName())); Map regionList = null; do { System.out.println("Table " + tableName + "may not be available... " + "Double checking: Sleeping for 5 minutes more..."); Thread.sleep(300000); regionList = table.getRegionsInfo(); System.out.println("Table " + tableName + ": Expected # Regions = " + (keysArray.size()+1) + " Actual number = " + ((regionList!=null)?regionList.size():0) ); } while ((regionList==null) || (regionList.size()!=(keysArray.size()+1))); On 5/20/11 4:19 PM, "Ted Yu (JIRA)" wrote: [ https://issues.apache.org/jira/browse/HBASE-3904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037150#comment-13037150 ] Ted Yu commented on HBASE-3904: ------------------------------- I have run tests related to table creation and availability checking. Namely this code in LoadIncrementalHFiles: {code} while (!conn.isTableAvailable(table.getTableName()) && (ctr HConnection.isTableAvailable returns true even with not all regions available. > ------------------------------------------------------------------------------ > > Key: HBASE-3904 > URL: https://issues.apache.org/jira/browse/HBASE-3904 > Project: HBase > Issue Type: Bug > Components: client > Reporter: Vidhyashankar Venkataraman > Priority: Minor > Attachments: 3904.txt > > > This function as per the java doc is supposed to return true iff "all the regions in the table are available". But if the table is still being created this function may return inconsistent results (For example, when a table with a large number of split keys is created). -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira