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 580C1CCA4 for ; Mon, 1 Jul 2013 04:18:40 +0000 (UTC) Received: (qmail 6084 invoked by uid 500); 1 Jul 2013 04:18:38 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 6007 invoked by uid 500); 1 Jul 2013 04:18:26 -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 5979 invoked by uid 99); 1 Jul 2013 04:18:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 04:18:21 +0000 Date: Mon, 1 Jul 2013 04:18:20 +0000 (UTC) From: "Ted Yu (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-8814) Possible NPE in split if a region has empty store files. 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-8814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13696463#comment-13696463 ] Ted Yu commented on HBASE-8814: ------------------------------- {code} + table = new HTable(conf, userTableName); {code} Please close table and admin at the end of the test. > Possible NPE in split if a region has empty store files. > -------------------------------------------------------- > > Key: HBASE-8814 > URL: https://issues.apache.org/jira/browse/HBASE-8814 > Project: HBase > Issue Type: Bug > Components: regionserver > Reporter: rajeshbabu > Assignee: rajeshbabu > Fix For: 0.98.0, 0.95.2, 0.94.10 > > Attachments: HBASE-8814_trunk.patch > > > {code} > 2013-06-27 14:12:54,472 INFO [RS:1;BLRY2R009039160:49833-splits-1372322572806] regionserver.SplitRequest(92): Running rollback/cleanup of failed split of testSplitShouldNotThrowNPEEvenARegionHasEmptySplitFiles,,1372322556662.276e00da1420119e2f91f3a4c4c41d78.; java.util.concurrent.ExecutionException: java.lang.NullPointerException > java.io.IOException: java.util.concurrent.ExecutionException: java.lang.NullPointerException > at org.apache.hadoop.hbase.regionserver.SplitTransaction.splitStoreFiles(SplitTransaction.java:602) > at org.apache.hadoop.hbase.regionserver.SplitTransaction.createDaughters(SplitTransaction.java:297) > at org.apache.hadoop.hbase.regionserver.SplitTransaction.execute(SplitTransaction.java:466) > at org.apache.hadoop.hbase.regionserver.SplitRequest.run(SplitRequest.java:82) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:662) > Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException > at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222) > at java.util.concurrent.FutureTask.get(FutureTask.java:83) > at org.apache.hadoop.hbase.regionserver.SplitTransaction.splitStoreFiles(SplitTransaction.java:596) > ... 6 more > Caused by: java.lang.NullPointerException > at org.apache.hadoop.hbase.regionserver.HRegionFileSystem.splitStoreFile(HRegionFileSystem.java:539) > at org.apache.hadoop.hbase.regionserver.SplitTransaction.splitStoreFile(SplitTransaction.java:610) > at org.apache.hadoop.hbase.regionserver.SplitTransaction.access$1(SplitTransaction.java:607) > at org.apache.hadoop.hbase.regionserver.SplitTransaction$StoreFileSplitter.call(SplitTransaction.java:633) > at org.apache.hadoop.hbase.regionserver.SplitTransaction$StoreFileSplitter.call(SplitTransaction.java:1) > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > ... 3 more > {code} > If a storefile is empty(can be because of puts and deletes) then first and lastkey of the file will be empty. Then we will get first or last key as null. Then we will end up in NPE when we will check splitkey in the range or not. > {code} > if (top) { > //check if larger than last key. > KeyValue splitKey = KeyValue.createFirstOnRow(splitRow); > byte[] lastKey = f.createReader().getLastKey(); > if (f.getReader().getComparator().compare(splitKey.getBuffer(), > splitKey.getKeyOffset(), splitKey.getKeyLength(), lastKey, 0, lastKey.length) > 0) { > return null; > } > } else { > //check if smaller than first key > KeyValue splitKey = KeyValue.createLastOnRow(splitRow); > byte[] firstKey = f.createReader().getFirstKey(); > if (f.getReader().getComparator().compare(splitKey.getBuffer(), > splitKey.getKeyOffset(), splitKey.getKeyLength(), firstKey, 0, firstKey.length) < 0) { > return null; > } > } > {code} -- 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