diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/MergeTableRegionsProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/MergeTableRegionsProcedure.java index 8375dd08575..41e77f8a1b5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/MergeTableRegionsProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/MergeTableRegionsProcedure.java @@ -402,8 +402,10 @@ public class MergeTableRegionsProcedure @Override protected LockState acquireLock(final MasterProcedureEnv env) { - if (env.getProcedureScheduler().waitRegions(this, getTableName(), - mergedRegion, regionsToMerge[0], regionsToMerge[1])) { + RegionInfo[] lockRegions = Arrays.copyOf(regionsToMerge, regionsToMerge.length + 1); + lockRegions[lockRegions.length - 1] = mergedRegion; + + if (env.getProcedureScheduler().waitRegions(this, getTableName(), lockRegions)) { try { LOG.debug(LockState.LOCK_EVENT_WAIT + " " + env.getProcedureScheduler().dumpLocks()); } catch (IOException e) { @@ -416,8 +418,10 @@ public class MergeTableRegionsProcedure @Override protected void releaseLock(final MasterProcedureEnv env) { - env.getProcedureScheduler().wakeRegions(this, getTableName(), - mergedRegion, regionsToMerge[0], regionsToMerge[1]); + RegionInfo[] lockRegions = Arrays.copyOf(regionsToMerge, regionsToMerge.length + 1); + lockRegions[lockRegions.length - 1] = mergedRegion; + + env.getProcedureScheduler().wakeRegions(this, getTableName(), lockRegions); } @Override