Repository: hbase Updated Branches: refs/heads/branch-1.1 3e28384b4 -> 797e38400
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/797e3840 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/797e3840 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/797e3840 Branch: refs/heads/branch-1.1 Commit: 797e3840003819ca6299dadbcad7486e241acc50 Parents: 3e28384 Author: tedyu <yuzhih...@gmail.com> Authored: Thu Feb 9 12:43:37 2017 -0800 Committer: Stephen Yuan Jiang <syuanjiang...@gmail.com> Committed: Sun Feb 12 07:12:22 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/797e3840/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 5c158e8..2c44306 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 @@ -1059,7 +1059,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/797e3840/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 64b64c4..f2d12cb 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 @@ -381,6 +381,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;