From a62eecc95a164415d8f924e1c88e2d144282395d Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 3 Apr 2013 23:16:44 +0000 Subject: [PATCH] HBASE-7923 force unassign can confirm region online on any RS to get rid of double assignments git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1464232 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/hadoop/hbase/master/HMaster.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 08358c3053a..ea71218f320 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -2267,11 +2267,14 @@ Server { return urr; } } - if (force) { - this.assignmentManager.regionOffline(hri); + LOG.debug("Close region " + hri.getRegionNameAsString() + + " on current location if it is online and reassign.force=" + force); + this.assignmentManager.unassign(hri, force); + if (!this.assignmentManager.getRegionStates().isRegionInTransition(hri) + && !this.assignmentManager.getRegionStates().isRegionAssigned(hri)) { + LOG.debug("Region " + hri.getRegionNameAsString() + + " is not online on any region server, reassigning it."); assignRegion(hri); - } else { - this.assignmentManager.unassign(hri, force); } if (cpHost != null) { cpHost.postUnassign(hri, force);