private Map<ServerName, List<ReplicationQueueId>> getUnDeletedQueues()
    throws ReplicationException {
    Map<ServerName, List<ReplicationQueueId>> undeletedQueues = new HashMap<>();
    Set<String> peerIds = new HashSet<>(peerStorage.listPeerIds());
    for (ReplicationQueueData queueData : queueStorage.listAllQueues()) {
      ReplicationQueueId queueId = queueData.getId();
      if (!peerIds.contains(queueId.getPeerId())) {
        undeletedQueues.computeIfAbsent(queueId.getServerName(), key -> new ArrayList<>())
          .add(queueId);
        LOG.debug(
          "Undeleted replication queue for removed peer found: "
            + "[removedPeerId={}, replicator={}, queueId={}]",
          queueId.getPeerId(), queueId.getServerName(), queueId);
      }
    }
    return undeletedQueues;
  }
Check and fix undeleted replication queues for removed peerId.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/ReplicationChecker.java