From b4676d51ad8087a7de3f9ea763cf611380aa0431 Mon Sep 17 00:00:00 2001 From: Eddie Elizondo Date: Fri, 21 Oct 2016 14:07:30 -0700 Subject: [PATCH] HBASE-14329 Report region in transition should check all regions in request Signed-off-by: Gary Helmling --- .../hbase/master/MasterRpcServices.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index 341bf1b4a74..f51a797d3ce 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -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);