You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2011/10/17 07:08:49 UTC

svn commit: r1185005 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java

Author: larsh
Date: Mon Oct 17 05:08:49 2011
New Revision: 1185005

URL: http://svn.apache.org/viewvc?rev=1185005&view=rev
Log:
HBASE-4563  When error occurs in this.parent.close(false) of split, the split region cannot write or read

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1185005&r1=1185004&r2=1185005&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Mon Oct 17 05:08:49 2011
@@ -734,6 +734,8 @@ Release 0.90.5 - Unreleased
    HBASE-4537  TestUser imports breaking build against secure Hadoop
    HBASE-4501  [replication] Shutting down a stream leaves recovered
                sources running
+   HBASE-4563  When error occurs in this.parent.close(false) of split,
+               the split region cannot write or read (bluedavy via Lars H)
 
   IMPROVEMENT
    HBASE-4205  Enhance HTable javadoc (Eric Charles)

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java?rev=1185005&r1=1185004&r2=1185005&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java Mon Oct 17 05:08:49 2011
@@ -246,18 +246,22 @@ public class SplitTransaction {
 
     createSplitDir(this.parent.getFilesystem(), this.splitdir);
     this.journal.add(JournalEntry.CREATE_SPLIT_DIR);
-
-    List<StoreFile> hstoreFilesToSplit = this.parent.close(false);
-    if (hstoreFilesToSplit == null) {
-      // The region was closed by a concurrent thread.  We can't continue
-      // with the split, instead we must just abandon the split.  If we
-      // reopen or split this could cause problems because the region has
-      // probably already been moved to a different server, or is in the
-      // process of moving to a different server.
-      throw new IOException("Failed to close region: already closed by " +
-        "another thread");
+ 
+    List<StoreFile> hstoreFilesToSplit = null;
+    try{
+      hstoreFilesToSplit = this.parent.close(false);
+      if (hstoreFilesToSplit == null) {
+        // The region was closed by a concurrent thread.  We can't continue
+        // with the split, instead we must just abandon the split.  If we
+        // reopen or split this could cause problems because the region has
+        // probably already been moved to a different server, or is in the
+        // process of moving to a different server.
+        throw new IOException("Failed to close region: already closed by " +
+          "another thread");
+      }
+    } finally {
+      this.journal.add(JournalEntry.CLOSED_PARENT_REGION);
     }
-    this.journal.add(JournalEntry.CLOSED_PARENT_REGION);
 
     if (!testing) {
       services.removeFromOnlineRegions(this.parent.getRegionInfo().getEncodedName());