private StuckRegion stickRegion(AssignmentManager am,
    ProcedureExecutor<MasterProcedureEnv> procExec, RegionInfo regionInfo) {
    RegionStateNode regionNode = am.getRegionStates().getRegionStateNode(regionInfo);
    TransitRegionStateProcedure trsp =
      TransitRegionStateProcedure.unassign(procExec.getEnvironment(), regionInfo);
    regionNode.lock();
    long openSeqNum;
    try {
      openSeqNum = regionNode.getOpenSeqNum();
      regionNode.setState(State.OPENING);
      regionNode.setOpenSeqNum(-1L);
      regionNode.setProcedure(trsp);
    } finally {
      regionNode.unlock();
    }
    return new StuckRegion(trsp, regionNode, openSeqNum);
  }
Confirm that we will batch region reopens when reopening all table regions. This can avoid the
pain associated with reopening too many regions at once.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureBatching.java