@Override
  protected Flow executeFromState(MasterProcedureEnv env, MasterProcedureProtos.SplitWALState state)
    throws ProcedureSuspendedException, ProcedureYieldException, InterruptedException {
    SplitWALManager splitWALManager = env.getMasterServices().getSplitWALManager();
    switch (state) {
      case ACQUIRE_SPLIT_WAL_WORKER:
        worker = splitWALManager.acquireSplitWALWorker(this);
        setNextState(MasterProcedureProtos.SplitWALState.DISPATCH_WAL_TO_WORKER);
        return Flow.HAS_MORE_STATE;
      case DISPATCH_WAL_TO_WORKER:
        assert worker != null;
        addChildProcedure(new SplitWALRemoteProcedure(worker, crashedServer, walPath));
        setNextState(MasterProcedureProtos.SplitWALState.RELEASE_SPLIT_WORKER);
        return Flow.HAS_MORE_STATE;
      case RELEASE_SPLIT_WORKER:
        boolean finished;
        try {
          finished = splitWALManager.isSplitWALFinished(walPath);
        } catch (IOException ioe) {
          if (retryCounter == null) {
            retryCounter = ProcedureUtil.createRetryCounter(env.getMasterConfiguration());
          }
          long backoff = retryCounter.getBackoffTimeAndIncrementAttempts();
          LOG.warn("Failed to check whether splitting wal {} success, wait {} seconds to retry",
            walPath, backoff / 1000, ioe);
          setTimeout(Math.toIntExact(backoff));
          setState(ProcedureProtos.ProcedureState.WAITING_TIMEOUT);
          skipPersistence();
          throw new ProcedureSuspendedException();
        }
        splitWALManager.releaseSplitWALWorker(worker, env.getProcedureScheduler());
        if (!finished) {
          LOG.warn("Failed to split wal {} by server {}, retry...", walPath, worker);
          setNextState(MasterProcedureProtos.SplitWALState.ACQUIRE_SPLIT_WAL_WORKER);
          return Flow.HAS_MORE_STATE;
        }
        ServerCrashProcedure.updateProgress(env, getParentProcId());
        return Flow.NO_MORE_STATE;
      default:
        throw new UnsupportedOperationException("unhandled state=" + state);
    }
  }
The procedure is to split a WAL. It will get an available region server and schedule a
{@link SplitWALRemoteProcedure} to actually send the request to region server to split this WAL.
It also check if the split wal task really succeed. If the WAL still exists, it will schedule
another region server to split this WAL.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SplitWALProcedure.java