@Override
    public void insert(Procedure<?> proc, Procedure<?>[] subprocs) {
      long max = proc.getProcId();
      synchronized (procMap) {
        try {
          procMap.put(proc.getProcId(), ProcedureUtil.convertToProtoProcedure(proc));
          if (subprocs != null) {
            for (Procedure<?> p : subprocs) {
              procMap.put(p.getProcId(), ProcedureUtil.convertToProtoProcedure(p));
              max = Math.max(max, p.getProcId());
            }
          }
        } catch (IOException e) {
          throw new UncheckedIOException(e);
        }
      }
      AtomicUtils.updateMax(maxProcId, max);
    }
Testcase for HBASE-28210, where we persist the procedure which has been inserted later to
{@link RootProcedureState} first and then crash, and then cause holes in stack ids when loading,
and finally fail the start up of master.
hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestStackIdHoles.java