@Override
  protected void prePeerModification(MasterProcedureEnv env) throws IOException {
    MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
    if (cpHost != null) {
      cpHost.preRemoveReplicationPeer(peerId);
    }
    peerConfig = env.getReplicationPeerManager().preRemovePeer(peerId);
  }
The procedure for removing a replication peer.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/RemovePeerProcedure.java