HBASE-4899 Region would be assigned twice easily with continually killing server and moving region in testing environment
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1209367 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
31468fa7ac
commit
5a0f0313b9
|
@ -286,7 +286,22 @@ public class ServerShutdownHandler extends EventHandler {
|
||||||
if (processDeadRegion(e.getKey(), e.getValue(),
|
if (processDeadRegion(e.getKey(), e.getValue(),
|
||||||
this.services.getAssignmentManager(),
|
this.services.getAssignmentManager(),
|
||||||
this.server.getCatalogTracker())) {
|
this.server.getCatalogTracker())) {
|
||||||
this.services.getAssignmentManager().assign(e.getKey(), true);
|
RegionState rit = this.services.getAssignmentManager().isRegionInTransition(e.getKey());
|
||||||
|
ServerName addressFromAM = this.services.getAssignmentManager()
|
||||||
|
.getRegionServerOfRegion(e.getKey());
|
||||||
|
if (rit != null && !rit.isClosing() && !rit.isPendingClose()) {
|
||||||
|
// Skip regions that were in transition unless CLOSING or
|
||||||
|
// PENDING_CLOSE
|
||||||
|
LOG.info("Skip assigning region " + rit.toString());
|
||||||
|
} else if (addressFromAM != null
|
||||||
|
&& !addressFromAM.equals(this.serverName)) {
|
||||||
|
LOG.debug("Skip assigning region "
|
||||||
|
+ e.getKey().getRegionNameAsString()
|
||||||
|
+ " because it has been opened in "
|
||||||
|
+ addressFromAM.getServerName());
|
||||||
|
} else {
|
||||||
|
this.services.getAssignmentManager().assign(e.getKey(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue