void refreshPeerReplicaTokens() {
    ConcurrentMap<String, Pair<Long, FindToken>> newPeerReplicaAndToken = new ConcurrentHashMap<>();
    // this should remove peer replica that no longer exists (i.e original replica is moved to other node)
    localReplica.getPeerReplicaIds().forEach(r -> {
      String hostnameAndPath = r.getDataNodeId().getHostname() + DELIMITER + r.getReplicaPath();
      newPeerReplicaAndToken.put(hostnameAndPath,
          peerReplicaAndToken.getOrDefault(hostnameAndPath, new Pair<>(time.milliseconds(), new StoreFindToken())));
    });
    // atomic switch
    peerReplicaAndToken = newPeerReplicaAndToken;
  }
Refresh the peerReplicaAndToken map in case peer replica has changed (i.e. new replica is added and old replica is removed)
ambry-store/src/main/java/com/github/ambry/store/RemoteTokenTracker.java