@Override
  protected void updatePeerStorage(MasterProcedureEnv env) throws ReplicationException {
    env.getReplicationPeerManager().removePeer(peerId);
    // record ongoing AssignReplicationQueuesProcedures after we update the peer storage
    ongoingAssignReplicationQueuesProcIds = env.getMasterServices().getMasterProcedureExecutor()
      .getProcedures().stream().filter(p -> p instanceof AssignReplicationQueuesProcedure)
      .filter(p -> !p.isFinished()).map(Procedure::getProcId).collect(Collectors.toList());
  }
The procedure for removing a replication peer.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/RemovePeerProcedure.java