hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raw...@apache.org
Subject svn commit: r1081985 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
Date Tue, 15 Mar 2011 23:03:48 GMT
Author: rawson
Date: Tue Mar 15 23:03:48 2011
New Revision: 1081985

URL: http://svn.apache.org/viewvc?rev=1081985&view=rev
Log:
HBASE-3613  NPE in MemStoreFlusher

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1081985&r1=1081984&r2=1081985&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Tue Mar 15 23:03:48 2011
@@ -30,6 +30,7 @@ Release 0.90.2 - February 9th, 2011
                ROWCOL bloomfilter (Liyin Tang via Stack)
    HBASE-3639  FSUtils.getRootDir should qualify path
    HBASE-3648  [replication] failover is sloppy with znodes
+   HBASE-3613  NPE in MemStoreFlusher
 
   IMPROVEMENTS
    HBASE-3542  MultiGet methods in Thrift

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java?rev=1081985&r1=1081984&r2=1081985&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
Tue Mar 15 23:03:48 2011
@@ -159,6 +159,7 @@ class MemStoreFlusher extends Thread imp
     boolean flushedOne = false;
     while (!flushedOne) {
       // Find the biggest region that doesn't have too many storefiles
+      // (might be null!)
       HRegion bestFlushableRegion = getBiggestMemstoreRegion(
           regionsBySize, excludedRegionNames, true);
       // Find the biggest region, total, even if it might have too many flushes.
@@ -166,12 +167,13 @@ class MemStoreFlusher extends Thread imp
           regionsBySize, excludedRegionNames, false);
 
       if (bestAnyRegion == null) {
-        LOG.fatal("Above memory mark but there are no flushable regions!");
+        LOG.error("Above memory mark but there are no flushable regions!");
         return false;
       }
 
       HRegion regionToFlush;
-      if (bestAnyRegion.memstoreSize.get() > 2 * bestFlushableRegion.memstoreSize.get())
{
+      if (bestFlushableRegion != null &&
+	  bestAnyRegion.memstoreSize.get() > 2 * bestFlushableRegion.memstoreSize.get()) {
         // Even if it's not supposed to be flushed, pick a region if it's more than twice
         // as big as the best flushable one - otherwise when we're under pressure we make
         // lots of little flushes and cause lots of compactions, etc, which just makes
@@ -183,9 +185,13 @@ class MemStoreFlusher extends Thread imp
             " vs best flushable region's " +
             StringUtils.humanReadableInt(bestFlushableRegion.memstoreSize.get()) +
             ". Choosing the bigger.");
-        regionToFlush = bestAnyRegion;
+	regionToFlush = bestAnyRegion;
       } else {
-        regionToFlush = bestFlushableRegion;
+	  if (bestFlushableRegion == null) {
+	      regionToFlush = bestAnyRegion;
+	  } else {
+	      regionToFlush = bestFlushableRegion;
+	  }
       }
 
       Preconditions.checkState(regionToFlush.memstoreSize.get() > 0);



Mime
View raw message