private void persistAndWake(MasterProcedureEnv env, RegionStateNode regionNode) {
    // The synchronization here is to guard with ProcedureExecutor.executeRollback, as here we will
    // not hold the procedure execution lock, but we should not persist a procedure in ROLLEDBACK
    // state to the procedure store.
    // The ProcedureStore.update must be inside the lock, so here the check for procedure state and
    // update could be atomic. In ProcedureExecutor.cleanupAfterRollbackOneStep, we will set the
    // state to ROLLEDBACK, which will hold the same lock too as the Procedure.setState method is
    // synchronized. This is the key to keep us safe.
    synchronized (this) {
      if (getState() == ProcedureState.ROLLEDBACK) {
        LOG.warn("Procedure {} has already been rolled back, skip persistent", this);
        return;
      }
      env.getMasterServices().getMasterProcedureExecutor().getStore().update(this);
    }
    regionNode.getProcedureEvent().wake(env.getProcedureScheduler());
  }
The base class for the remote procedures used to open/close a region.
<p/>
Notice that here we do not care about the result of the remote call, if the remote call is
finished, either succeeded or not, we will always finish the procedure. The parent procedure
should take care of the result and try to reschedule if the result is not good.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionRemoteProcedureBase.java