private void checkUnsupportedProcedure(Map<Class<?>, List<Procedure<?>>> procsByType)
    throws HBaseIOException {
    // Confirm that we do not have unfinished assign/unassign related procedures. It is not easy to
    // support both the old assign/unassign procedures and the new TransitRegionStateProcedure as
    // there will be conflict in the code for AM. We should finish all these procedures before
    // upgrading.
    for (Class<?> clazz : UNSUPPORTED_PROCEDURES) {
      List<Procedure<?>> procs = procsByType.get(clazz);
      if (procs != null) {
        LOG.error("Unsupported procedure type {} found, please rollback your master to the old"
          + " version to finish them, and then try to upgrade again."
          + " See https://hbase.apache.org/book.html#upgrade2.2 for more details."
          + " The full procedure list: {}", clazz, procs);
        throw new HBaseIOException("Unsupported procedure type " + clazz + " found");
      }
    }
    // A special check for SCP, as we do not support RecoverMetaProcedure any more so we need to
    // make sure that no one will try to schedule it but SCP does have a state which will schedule
    // it.
    if (
      procsByType.getOrDefault(ServerCrashProcedure.class, Collections.emptyList()).stream()
        .map(p -> (ServerCrashProcedure) p).anyMatch(ServerCrashProcedure::isInRecoverMetaState)
    ) {
      LOG.error("At least one ServerCrashProcedure is going to schedule a RecoverMetaProcedure,"
        + " which is not supported any more. Please rollback your master to the old version to"
        + " finish them, and then try to upgrade again."
        + " See https://hbase.apache.org/book.html#upgrade2.2 for more details.");
      throw new HBaseIOException("Unsupported procedure state found for ServerCrashProcedure");
    }
  }
In HBASE-20811, we have introduced a new TRSP to assign/unassign/move regions, and it is
incompatible with the old AssignProcedure/UnassignProcedure/MoveRegionProcedure. So we need to
make sure that there are none these procedures when upgrading. If there are, the master will
quit, you need to go back to the old version to finish these procedures first before upgrading.
hbase-server/src/main/java/org/apache/hadoop/hbase/procedure2/store/region/RegionProcedureStore.java