@Override
  protected void postPeerModification(MasterProcedureEnv env)
    throws IOException, ReplicationException, ProcedureSuspendedException {
    checkAssignReplicationQueuesFinished(env);

    if (peerConfig.isSyncReplication()) {
      removeRemoteWALs(env);
    }
    env.getReplicationPeerManager().removeAllQueuesAndHFileRefs(peerId);
    if (peerConfig.isSerial()) {
      env.getReplicationPeerManager().removeAllLastPushedSeqIds(peerId);
    }
    LOG.info("Successfully removed peer {}", peerId);
    MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
    if (cpHost != null) {
      cpHost.postRemoveReplicationPeer(peerId);
    }
  }
The procedure for removing a replication peer.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/RemovePeerProcedure.java