hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject git commit: HBASE-11380 HRegion lock object is not being released properly, leading to snapshot failure
Date Tue, 24 Jun 2014 03:06:48 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 092fc71b1 -> af9e519e0


HBASE-11380 HRegion lock object is not being released properly, leading to snapshot failure


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/af9e519e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/af9e519e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/af9e519e

Branch: refs/heads/master
Commit: af9e519e00764af9d372a22953b03e660c9aa6f0
Parents: 092fc71
Author: Ted Yu <tedyu@apache.org>
Authored: Tue Jun 24 03:06:40 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Tue Jun 24 03:06:40 2014 +0000

----------------------------------------------------------------------
 .../hadoop/hbase/client/TableSnapshotScanner.java   | 16 ++++++++++------
 .../apache/hadoop/hbase/regionserver/HRegion.java   |  8 ++++++--
 2 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/af9e519e/hbase-server/src/main/java/org/apache/hadoop/hbase/client/TableSnapshotScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/TableSnapshotScanner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/TableSnapshotScanner.java
index f2519c2..177ff9b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/TableSnapshotScanner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/TableSnapshotScanner.java
@@ -176,12 +176,16 @@ public class TableSnapshotScanner extends AbstractClientScanner {
         }
       }
 
-      result = currentRegionScanner.next();
-      if (result != null) {
-        return result;
-      } else {
-        currentRegionScanner.close();
-        currentRegionScanner = null;
+      try {
+        result = currentRegionScanner.next();
+        if (result != null) {
+          return result;
+        }
+      } finally {
+        if (result == null) {
+          currentRegionScanner.close();
+          currentRegionScanner = null;
+        }        
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/af9e519e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index bea8f45..5b7d41d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -4841,8 +4841,12 @@ public class HRegion implements HeapSize { // , Writable{
     WALEdit walEdit = new WALEdit();
 
     // 1. Run pre-process hook
-    processor.preProcess(this, walEdit);
-
+    try {
+      processor.preProcess(this, walEdit);
+    } catch (IOException e) {
+      closeRegionOperation();
+      throw e;
+    }
     // Short circuit the read only case
     if (processor.readOnly()) {
       try {


Mime
View raw message