HBASE-14329 Report region in transition should check all regions in request
Signed-off-by: Gary Helmling <garyh@apache.org>
This commit is contained in:
parent
4fe51ebaa7
commit
b4676d51ad
|
@ -1427,15 +1427,16 @@ public class MasterRpcServices extends RSRpcServices
|
|||
try {
|
||||
master.checkServiceStarted();
|
||||
RegionStateTransition rt = req.getTransition(0);
|
||||
TableName tableName = ProtobufUtil.toTableName(
|
||||
rt.getRegionInfo(0).getTableName());
|
||||
RegionStates regionStates = master.assignmentManager.getRegionStates();
|
||||
if (!(TableName.META_TABLE_NAME.equals(tableName)
|
||||
&& regionStates.getRegionState(HRegionInfo.FIRST_META_REGIONINFO) != null)
|
||||
&& !master.assignmentManager.isFailoverCleanupDone()) {
|
||||
// Meta region is assigned before master finishes the
|
||||
// failover cleanup. So no need this check for it
|
||||
throw new PleaseHoldException("Master is rebuilding user regions");
|
||||
RegionStates regionStates = master.getAssignmentManager().getRegionStates();
|
||||
for (HBaseProtos.RegionInfo ri : rt.getRegionInfoList()) {
|
||||
TableName tableName = ProtobufUtil.toTableName(ri.getTableName());
|
||||
if (!(TableName.META_TABLE_NAME.equals(tableName)
|
||||
&& regionStates.getRegionState(HRegionInfo.FIRST_META_REGIONINFO) != null)
|
||||
&& !master.getAssignmentManager().isFailoverCleanupDone()) {
|
||||
// Meta region is assigned before master finishes the
|
||||
// failover cleanup. So no need this check for it
|
||||
throw new PleaseHoldException("Master is rebuilding user regions");
|
||||
}
|
||||
}
|
||||
ServerName sn = ProtobufUtil.toServerName(req.getServer());
|
||||
String error = master.assignmentManager.onRegionTransition(sn, rt);
|
||||
|
|
Loading…
Reference in New Issue