Repository: hbase
Updated Branches:
  refs/heads/branch-1 807fcfd22 -> 52c51fc27


HBASE-17265 Region left unassigned in master failover when region failed to 
open (Allan Yang)


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

Branch: refs/heads/branch-1
Commit: 52c51fc271b8bf0e3dfc8dc05513cc61ce689787
Parents: 807fcfd
Author: tedyu <yuzhih...@gmail.com>
Authored: Thu Feb 9 12:43:37 2017 -0800
Committer: tedyu <yuzhih...@gmail.com>
Committed: Thu Feb 9 12:43:37 2017 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/master/AssignmentManager.java |  2 +-
 .../java/org/apache/hadoop/hbase/master/RegionStates.java | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/52c51fc2/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
index bf50d48..fe94f42 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
@@ -1091,7 +1091,7 @@ public class AssignmentManager extends ZooKeeperListener {
             failedOpenTracker.remove(encodedName);
           } else {
             // Handle this the same as if it were opened and then closed.
-            regionState = regionStates.updateRegionState(rt, State.CLOSED);
+            regionState = 
regionStates.setRegionStateTOCLOSED(rt.getRegionName(), sn);
             if (regionState != null) {
               // When there are more than one region server a new RS is 
selected as the
               // destination and the same is updated in the regionplan. 
(HBASE-5546)

http://git-wip-us.apache.org/repos/asf/hbase/blob/52c51fc2/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
index c2c45d2..6cc8b49 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
@@ -423,6 +423,16 @@ public class RegionStates {
    * Set the region state to CLOSED
    */
   public RegionState setRegionStateTOCLOSED(
+      final byte[] regionName,
+      final ServerName serverName) {
+    HRegionInfo regionInfo = getRegionInfo(regionName);
+    return setRegionStateTOCLOSED(regionInfo, serverName);
+  }
+
+  /**
+   * Set the region state to CLOSED
+   */
+  public RegionState setRegionStateTOCLOSED(
       final HRegionInfo regionInfo,
       final ServerName serverName) {
     ServerName sn = serverName;

Reply via email to