private void logIfQueueChanged(DiskId diskId, LinkedHashSet<ReplicaId> previousQueue,
      LinkedHashSet<ReplicaId> newQueue) {
    if (previousQueue.size() != newQueue.size()) {
      logger.info("For disk {} queue has changed from {} to {}", diskId, previousQueue, newQueue);
      return;
    }

    List<ReplicaId> previousQueueList = new ArrayList<>(previousQueue);
    List<ReplicaId> newQueueList = new ArrayList<>(newQueue);

    for (int i = 0; i < previousQueueList.size(); i++) {
      if (previousQueueList.get(i).equals(newQueueList.get(i))) {
        logger.info("For disk {} queue has changed from {} to {}", diskId, previousQueue, newQueue);
        break;
      }
    }
  }
This always keeps running
For each disk's pending queue, it calculates belowMinActiveReplicas
then sorts these by disruption priority and adds to the result, and then it calculates equalMinActiveReplicas
then sorts these by disruption priority, and adds these to result next, and it then
sorts remaining replicas by disruption priority and adds these result
Then the current pending queue is replaced by the result
ambry-prioritization/src/main/java/com/github/ambry/replica/prioritization/FileCopyDisruptionBasedPrioritizationManager.java