private String maybeReassignOriginatingDC(String originatingDcName, List<? extends ReplicaId> replicas) {
    String reassignedOriginDc = null;
    if (originatingDcName == null && routerConfig.routerCrossColoRequestToDcWithMostReplicas) {
      Map<String, Long> dcToReplicaCnt = replicas.stream()
          .collect(Collectors.groupingBy(e -> e.getDataNodeId().getDatacenterName(), Collectors.counting()));
      List<Map.Entry<String, Long>> entryList = new ArrayList<>(dcToReplicaCnt.entrySet());
      entryList.sort(Map.Entry.comparingByValue());
      // we assign a dc with most replicas to "originatingDcName", which only takes effect when populating replica pool
      // (replicas in that colo have higher priority than other remote colos). Note that, "this.originatingDcName" still
      // keeps the actual originating dc name (which is null). This value forces operation tracker to go through replicas
      // in all dc(s) rather than terminating on not found in originating dc.
      reassignedOriginDc = entryList.get(entryList.size() - 1).getKey();
      logger.debug("Originating dc name is null and has been re-assigned to {}", reassignedOriginDc);
    }
    return reassignedOriginDc;
  }
In a case where a certain dc is decommissioned and blobs previously uploaded to this dc now have an unrecognizable
dc id. Current clustermap code will treat originating dc as null if dc id is not identifiable. To improve success
rate of cross-colo requests(GET/DELETE/TTLUpdate), operation tracker should be allowed to try remote dc with most
replicas first. This is useful in cluster with "unbalanced" replica distribution (i.e. 3 replicas in local dc and
1 replica per remote dc)
@param originatingDcName The originating Dc name
@param replicas The list of replicas
@return The reassigned originating dc name.
ambry-router/src/main/java/com/github/ambry/router/SimpleOperationTracker.java