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:19:17 UTC

svn commit: r1185010 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java

Author: larsh
Date: Mon Oct 17 05:19:16 2011
New Revision: 1185010

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

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

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1185010&r1=1185009&r2=1185010&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Mon Oct 17 05:19:16 2011
@@ -76,6 +76,8 @@ Release 0.90.5 - Unreleased
    HBASE-4540  Addendum for TestMasterFailOver (Ram) - Breaks the build
    HBASE-4282  Ensure RegionServer aborts when WAL close fails with
                deferred flush edits
+   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/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java?rev=1185010&r1=1185009&r2=1185010&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java Mon Oct 17 05:19:16 2011
@@ -218,17 +218,21 @@ 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());