client-spark/spark2/src/main/java/org/apache/spark/shuffle/writer/RssShuffleWriter.java [329:354]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private void checkSentBlockCount() {
    long expected = blockIds.size();
    long bufferManagerTracked = bufferManager.getBlockCount();

    if (serverToPartitionToBlockIds == null) {
      throw new RssException("serverToPartitionToBlockIds should not be null");
    }

    // to filter the multiple replica's duplicate blockIds
    Set<Long> blockIds = new HashSet<>();
    for (Map<Integer, Set<Long>> partitionBlockIds : serverToPartitionToBlockIds.values()) {
      partitionBlockIds.values().forEach(x -> blockIds.addAll(x));
    }
    long serverTracked = blockIds.size();
    if (expected != serverTracked || expected != bufferManagerTracked) {
      throw new RssSendFailedException(
          "Potential block loss may occur for task["
              + taskId
              + "]. BlockId number expected: "
              + expected
              + ", serverTracked: "
              + serverTracked
              + ", bufferManagerTracked: "
              + bufferManagerTracked);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



client-spark/spark3/src/main/java/org/apache/spark/shuffle/writer/RssShuffleWriter.java [415:440]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private void checkSentBlockCount() {
    long expected = blockIds.size();
    long bufferManagerTracked = bufferManager.getBlockCount();

    if (serverToPartitionToBlockIds == null) {
      throw new RssException("serverToPartitionToBlockIds should not be null");
    }

    // to filter the multiple replica's duplicate blockIds
    Set<Long> blockIds = new HashSet<>();
    for (Map<Integer, Set<Long>> partitionBlockIds : serverToPartitionToBlockIds.values()) {
      partitionBlockIds.values().forEach(x -> blockIds.addAll(x));
    }
    long serverTracked = blockIds.size();
    if (expected != serverTracked || expected != bufferManagerTracked) {
      throw new RssSendFailedException(
          "Potential block loss may occur for task["
              + taskId
              + "]. BlockId number expected: "
              + expected
              + ", serverTracked: "
              + serverTracked
              + ", bufferManagerTracked: "
              + bufferManagerTracked);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



