private String regionOperationCommonCheck(
      TConsensusGroupId regionId,
      TDataNodeLocation targetDataNode,
      List<Pair<String, TDataNodeLocation>> relatedDataNodes,
      Model model) {
    String failMessage;
    ConfigNodeConfig conf = ConfigNodeDescriptor.getInstance().getConf();

    if (TConsensusGroupType.DataRegion == regionId.getType()
        && ConsensusFactory.SIMPLE_CONSENSUS.equals(conf.getDataRegionConsensusProtocolClass())) {
      failMessage = "SimpleConsensus not supports region operation.";
    } else if (TConsensusGroupType.SchemaRegion == regionId.getType()
        && ConsensusFactory.SIMPLE_CONSENSUS.equals(conf.getSchemaRegionConsensusProtocolClass())) {
      failMessage = "SimpleConsensus not supports region operation.";
    } else if ((failMessage = checkRegionOperationDuplication(regionId)) != null) {
      // need to do nothing more
    } else if (relatedDataNodes.stream().anyMatch(pair -> pair.getRight() == null)) {
      Pair<String, TDataNodeLocation> nullPair =
          relatedDataNodes.stream().filter(pair -> pair.getRight() == null).findAny().get();
      failMessage = String.format("Cannot find %s", nullPair.getLeft());
    } else if (targetDataNode != null
        && !configManager.getNodeManager().filterDataNodeThroughStatus(NodeStatus.Running).stream()
            .map(TDataNodeConfiguration::getLocation)
            .map(TDataNodeLocation::getDataNodeId)
            .collect(Collectors.toSet())
            .contains(targetDataNode.getDataNodeId())) {
      // Here we only check Running DataNode to implement migration, because removing nodes may not
      // exist when add peer is performing
      failMessage =
          String.format(
              "Target DataNode %s is not in Running status.", targetDataNode.getDataNodeId());
    } else if ((failMessage = checkRegionOperationWithRemoveDataNode(regionId, targetDataNode))
        != null) {
      // need to do nothing more
    } else if ((failMessage = checkRegionOperationModelCorrectness(regionId, model)) != null) {
      // need to do nothing more
    }

    return failMessage;
  }
The common checks of all region operations, include migration, reconstruction, extension,
removing

@param regionId region group id, also called consensus group id
@param targetDataNode DataNode should in Running status
@param relatedDataNodes Pair<Identity, Node Location>
@return The reason if check failed, or null if check pass
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java