synchronized void updateMissingMessagesInMetadataResponse(List<MessageInfo> messagesWrittenToStore) {
    Set<MessageInfo> missingStoreMessages = exchangeMetadataResponse.getMissingStoreMessages();
    if (!missingStoreMessages.isEmpty()) {
      Set<StoreKey> keysWrittenToStore =
          messagesWrittenToStore.stream().map(MessageInfo::getStoreKey).collect(Collectors.toSet());
      Set<MessageInfo> missingMessagesFoundInStore = missingStoreMessages.stream()
          .filter(message -> keysWrittenToStore.contains(message.getStoreKey()))
          .collect(Collectors.toSet());
      exchangeMetadataResponse.removeMissingStoreMessages(missingMessagesFoundInStore);
    }
  }
Update missing store messages found for this replica in its recent exchange metadata response by comparing
(based on the store key) with messages that are written to store by other replica threads.
@param messagesWrittenToStore list of messages written to local store
ambry-replication/src/main/java/com/github/ambry/replication/RemoteReplicaInfo.java