hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars George (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-3492) NPE while splitting table with empty column family store
Date Mon, 31 Jan 2011 09:50:11 GMT

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

Lars George commented on HBASE-3492:
------------------------------------

Checking the Store.java code the issue is obvious:

{code}
      StoreFile largestSf = null;
      for (StoreFile sf : storefiles) {
        if (splitable) {
          splitable = !sf.isReference();
          if (!splitable) {
            // RETURN IN MIDDLE OF FUNCTION!!! If not splitable, just return.
            if (LOG.isDebugEnabled()) {
              LOG.debug(sf +  " is not splittable");
            }
            return null;
          }
        }
        StoreFile.Reader r = sf.getReader();
        if (r == null) {
          LOG.warn("Storefile " + sf + " Reader is null");
          continue;
        }
        long size = r.length();
        if (size > maxSize) {
          // This is the largest one so far
          maxSize = size;
          largestSf = sf;
        }
      }
      // if the user explicit set a split point, use that
      if (this.region.getSplitPoint() != null) {
        return new StoreSize(maxSize, this.region.getSplitPoint());
      }
      StoreFile.Reader r = largestSf.getReader();
{code}

The "largestSf" is never assigned. Needs a simple extra "if" to guard. Any objections to fix
this trivial issue without a review (but I will test it first obviously)?

> NPE while splitting table with empty column family store
> --------------------------------------------------------
>
>                 Key: HBASE-3492
>                 URL: https://issues.apache.org/jira/browse/HBASE-3492
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.90.0
>            Reporter: Lars George
>            Priority: Minor
>
> I did a simple test on trunk where I create a table (after wiping the local /tmp/hbase-<username>):
> {code}
> hbase(main):001:0> create 'testtable', 'cf1', 'cf2'                              
                                                                   
> {code}
> Then I inserted 17k rows:
> {code}
> hbase(main):002:0> for i in 'a'..'z' do for j in 'a'..'z' do for k in 'a'..'z' do
put 'testtable', "row-#{i}#{j}#{k}", "cf1:#{k}", "#{k}" end end end
> {code}
> and called 
> {code}
> hbase(main):003:0> split 'testttable'
> {code}
> and the logs gave this NPE and _no_ split was performed:
> {code}
> 2011-01-31 10:06:38,534 DEBUG org.apache.hadoop.hbase.regionserver.HRegion: Started memstore
flush for testtable,,1296461957099.2528e23534565a83e2c8590d33f3a47c., current region memstore
size 3.5m
> 2011-01-31 10:06:38,575 DEBUG org.apache.hadoop.hbase.regionserver.HRegion: Finished
snapshotting, commencing flushing stores
> 2011-01-31 10:06:38,856 INFO org.apache.hadoop.hbase.regionserver.Store: Renaming flushed
file at file:/tmp/hbase-larsgeorge/hbase/testtable/2528e23534565a83e2c8590d33f3a47c/.tmp/5265602271926296451
to file:/tmp/hbase-larsgeorge/hbase/testtable/2528e23534565a83e2c8590d33f3a47c/cf1/5349044325262044918
> 2011-01-31 10:06:38,861 INFO org.apache.hadoop.hbase.regionserver.Store: Added file:/tmp/hbase-larsgeorge/hbase/testtable/2528e23534565a83e2c8590d33f3a47c/cf1/5349044325262044918,
entries=17576, sequenceid=17588, memsize=3.5m, filesize=549.9k
> 2011-01-31 10:06:38,863 INFO org.apache.hadoop.hbase.regionserver.HRegion: Finished memstore
flush of ~3.5m for region testtable,,1296461957099.2528e23534565a83e2c8590d33f3a47c. in 328ms,
sequenceid=17588, compaction requested=false
> 2011-01-31 10:06:38,869 INFO org.apache.hadoop.hbase.regionserver.HRegion: Starting compaction
on region testtable,,1296461957099.2528e23534565a83e2c8590d33f3a47c.
> 2011-01-31 10:06:38,870 INFO org.apache.hadoop.hbase.regionserver.HRegion: aborted compaction
on region testtable,,1296461957099.2528e23534565a83e2c8590d33f3a47c. after 0sec
> 2011-01-31 10:06:38,872 ERROR org.apache.hadoop.hbase.regionserver.CompactSplitThread:
Compaction failed for region testtable,,1296461957099.2528e23534565a83e2c8590d33f3a47c.
> java.lang.NullPointerException
>         at org.apache.hadoop.hbase.regionserver.Store.checkSplit(Store.java:1367)
>         at org.apache.hadoop.hbase.regionserver.Store.compact(Store.java:633)
>         at org.apache.hadoop.hbase.regionserver.HRegion.compactStores(HRegion.java:793)
>         at org.apache.hadoop.hbase.regionserver.CompactSplitThread.run(CompactSplitThread.java:81)
> 2011-01-31 10:06:38,873 DEBUG org.apache.hadoop.hbase.regionserver.CompactSplitThread:
Compaction requested for testtable,,1296461957099.2528e23534565a83e2c8590d33f3a47c. because
User-triggered split; priority=1, compaction queue size=0
> {code}
> I added a row with data in cf2:
> {code}
> hbase(main):005:0> put 'testtable', 'row1', 'cf2', 'test1'                       
                                                                   
> {code}
> and the tried to split the table again like above and now it worked.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message