public void removeRegionFromServer(final ServerName serverName,
    final RegionStateNode regionNode) {
    ServerStateNode serverNode = getServerNode(serverName);
    // here the server node could be null. For example, if there is already a TRSP for a region and
    // at the same time, the target server is crashed and there is a SCP. The SCP will interrupt the
    // TRSP and the TRSP will first set the region as abnormally closed and remove it from the
    // server node. But here, this TRSP is not a child procedure of the SCP, so it is possible that
    // the SCP finishes, thus removes the server node for this region server, before the TRSP wakes
    // up and enter here to remove the region node from the server node, then we will get a null
    // server node here.
    if (serverNode != null) {
      serverNode.removeRegion(regionNode);
    }
  }
Returns Pertinent ServerStateNode or NULL if none found (Do not make modifications).
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStates.java