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 9B4A9E5DE for ; Mon, 25 Feb 2013 22:46:14 +0000 (UTC) Received: (qmail 1717 invoked by uid 500); 25 Feb 2013 22:46:14 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 1680 invoked by uid 500); 25 Feb 2013 22:46:14 -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 1669 invoked by uid 99); 25 Feb 2013 22:46:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 22:46:14 +0000 Date: Mon, 25 Feb 2013 22:46:14 +0000 (UTC) From: "Harsh J (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-5071) HFile has a possible cast issue. 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-5071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13586395#comment-13586395 ] Harsh J commented on HBASE-5071: -------------------------------- Hi Max, Why go down that path instead of upgrading to HFileV2? > HFile has a possible cast issue. > -------------------------------- > > Key: HBASE-5071 > URL: https://issues.apache.org/jira/browse/HBASE-5071 > Project: HBase > Issue Type: Bug > Components: HFile, io > Affects Versions: 0.90.0 > Reporter: Harsh J > Labels: hfile > Fix For: 0.96.0 > > > HBASE-3040 introduced this line originally in HFile.Reader#loadFileInfo(...): > {code} > int allIndexSize = (int)(this.fileSize - this.trailer.dataIndexOffset - FixedFileTrailer.trailerSize()); > {code} > Which on trunk today, for HFile v1 is: > {code} > int sizeToLoadOnOpen = (int) (fileSize - trailer.getLoadOnOpenDataOffset() - > trailer.getTrailerSize()); > {code} > This computed (and casted) integer is then used to build an array of the same size. But if fileSize is very large (>> Integer.MAX_VALUE), then there's an easy chance this can go negative at some point and spew out exceptions such as: > {code} > java.lang.NegativeArraySizeException > at org.apache.hadoop.hbase.io.hfile.HFile$Reader.readAllIndex(HFile.java:805) > at org.apache.hadoop.hbase.io.hfile.HFile$Reader.loadFileInfo(HFile.java:832) > at org.apache.hadoop.hbase.regionserver.StoreFile$Reader.loadFileInfo(StoreFile.java:1003) > at org.apache.hadoop.hbase.regionserver.StoreFile.open(StoreFile.java:382) > at org.apache.hadoop.hbase.regionserver.StoreFile.createReader(StoreFile.java:438) > at org.apache.hadoop.hbase.regionserver.Store.loadStoreFiles(Store.java:267) > at org.apache.hadoop.hbase.regionserver.Store.(Store.java:209) > at org.apache.hadoop.hbase.regionserver.HRegion.instantiateHStore(HRegion.java:2088) > at org.apache.hadoop.hbase.regionserver.HRegion.initialize(HRegion.java:358) > at org.apache.hadoop.hbase.regionserver.HRegion.openHRegion(HRegion.java:2661) > at org.apache.hadoop.hbase.regionserver.HRegion.openHRegion(HRegion.java:2647) > {code} > Did we accidentally limit single region sizes this way? > (Unsure about HFile v2's structure so far, so do not know if v2 has the same issue.) -- 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