public TSStatus submitDeleteOldRegionPeerTask(
      long procedureId, TDataNodeLocation originalDataNode, TConsensusGroupId regionId) {

    TSStatus status;
    TMaintainPeerReq maintainPeerReq =
        new TMaintainPeerReq(regionId, originalDataNode, procedureId);

    status =
        configManager.getLoadManager().getNodeStatus(originalDataNode.getDataNodeId())
                == NodeStatus.Unknown
            ? (TSStatus)
                SyncDataNodeClientPool.getInstance()
                    .sendSyncRequestToDataNodeWithGivenRetry(
                        originalDataNode.getInternalEndPoint(),
                        maintainPeerReq,
                        CnToDnSyncRequestType.DELETE_OLD_REGION_PEER,
                        1)
            : (TSStatus)
                SyncDataNodeClientPool.getInstance()
                    .sendSyncRequestToDataNodeWithRetry(
                        originalDataNode.getInternalEndPoint(),
                        maintainPeerReq,
                        CnToDnSyncRequestType.DELETE_OLD_REGION_PEER);
    LOGGER.info(
        "{}, Send action deleteOldRegionPeer finished, regionId: {}, dataNodeId: {}",
        REGION_MIGRATE_PROCESS,
        regionId,
        originalDataNode.getInternalEndPoint());
    return status;
  }
Delete a Region peer in the given ConsensusGroup and all of its data on the specified DataNode

<p>If the originalDataNode is down, we should delete local data and do other cleanup works
manually.

@param originalDataNode The DataNodeLocation who contains the original RegionReplica
@param regionId region id
@return TSStatus
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/RegionMaintainHandler.java