hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1301676 - in /hbase/branches/0.94/src: main/java/org/apache/hadoop/hbase/regionserver/HRegion.java test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
Date Fri, 16 Mar 2012 18:06:50 GMT
Author: tedyu
Date: Fri Mar 16 18:06:50 2012
New Revision: 1301676

URL: http://svn.apache.org/viewvc?rev=1301676&view=rev
Log:
HBASE-5568 Multi concurrent flushcache() for one region could cause data loss (Chunhui)

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1301676&r1=1301675&r2=1301676&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Fri
Mar 16 18:06:50 2012
@@ -1304,22 +1304,22 @@ public class HRegion implements HeapSize
         status.setStatus("Running coprocessor pre-flush hooks");
         coprocessorHost.preFlush();
       }
-      try {
-        synchronized (writestate) {
-          if (!writestate.flushing && writestate.writesEnabled) {
-            this.writestate.flushing = true;
-          } else {
-            if (LOG.isDebugEnabled()) {
-              LOG.debug("NOT flushing memstore for region " + this +
-                  ", flushing=" +
-                  writestate.flushing + ", writesEnabled=" +
-                  writestate.writesEnabled);
-            }
-            status.abort("Not flushing since " +
-                (writestate.flushing ? "already flushing" : "writes not enabled"));
-            return false;
-          }
+      synchronized (writestate) {
+        if (!writestate.flushing && writestate.writesEnabled) {
+          this.writestate.flushing = true;
+        } else {
+          if (LOG.isDebugEnabled()) {
+            LOG.debug("NOT flushing memstore for region " + this
+                + ", flushing=" + writestate.flushing + ", writesEnabled="
+                + writestate.writesEnabled);
+          }
+          status.abort("Not flushing since "
+              + (writestate.flushing ? "already flushing"
+                  : "writes not enabled"));
+          return false;
         }
+      }
+      try {
         boolean result = internalFlushcache(status);
 
         if (coprocessorHost != null) {

Modified: hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java?rev=1301676&r1=1301675&r2=1301676&view=diff
==============================================================================
--- hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
(original)
+++ hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
Fri Mar 16 18:06:50 2012
@@ -152,7 +152,7 @@ public class TestStore extends TestCase 
 
   public void testDeleteExpiredStoreFiles() throws Exception {
     int storeFileNum = 4;
-    int ttl = 1;
+    int ttl = 4;
     
     Configuration conf = HBaseConfiguration.create();
     // Enable the expired store file deletion



Mime
View raw message