@Override
    CompletableFuture<Void> persistToMeta(RegionStateNode regionNode) {
      TransitRegionStateProcedure proc = regionNode.getProcedure();
      if (!regionNode.getRegionInfo().isMetaRegion() && proc.hasParent()) {
        Procedure<?> p =
          getMaster().getMasterProcedureExecutor().getProcedure(proc.getRootProcId());
        // fail the procedure if it is a sub procedure for SCP
        if (p instanceof ServerCrashProcedure) {
          if (INJECTED.compareAndSet(false, true)) {
            ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdateInRollback(
              getMaster().getMasterProcedureExecutor(), true);
          }
          return FutureUtils.failedFuture(new RuntimeException("inject code bug"));
        }
      }
      return super.persistToMeta(regionNode);
    }
SCP does not support rollback actually, here we just want to simulate that when there is a code
bug, SCP and its sub procedures will not hang there forever, and it will not mess up the
procedure store.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRollbackSCP.java