HBASE-16816 HMaster.move() should throw exception if region to move is not online (Allan Yang)
This commit is contained in:
parent
ca581874b9
commit
57d3e9e756
|
@ -1501,6 +1501,11 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
|
|||
getRegionState(Bytes.toString(encodedRegionName));
|
||||
if (regionState == null) {
|
||||
throw new UnknownRegionException(Bytes.toStringBinary(encodedRegionName));
|
||||
} else if (!assignmentManager.getRegionStates()
|
||||
.isRegionOnline(regionState.getRegion())) {
|
||||
throw new HBaseIOException(
|
||||
"moving region not onlined: " + regionState.getRegion() + ", "
|
||||
+ regionState);
|
||||
}
|
||||
|
||||
HRegionInfo hri = regionState.getRegion();
|
||||
|
|
|
@ -157,6 +157,8 @@ public class TestWarmupRegion {
|
|||
HRegionServer rs = TEST_UTIL.getMiniHBaseCluster().getRegionServer(serverid);
|
||||
byte [] destName = Bytes.toBytes(rs.getServerName().toString());
|
||||
TEST_UTIL.getMiniHBaseCluster().getMaster().move(info.getEncodedNameAsBytes(), destName);
|
||||
//wait region online
|
||||
TEST_UTIL.waitUntilNoRegionsInTransition(1000);
|
||||
serverid = (serverid + 1) % 2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue