public void removeLeaderPartition(String partitionName) {
      // Read-write lock avoids contention from threads adding new leaders (addPartition()) and
      // threads updating existing leader partitions (refreshPeerLeadersForAllPartitions())
      rwLockForLeaderReplicaUpdates.writeLock().lock();
      try {
        logger.info("Removing leader Partition {} on node {} from an in-memory map", partitionName, dataNodeId);
        leaderPartitionToPeerLeaderReplicas.remove(partitionName);
      } finally {
        rwLockForLeaderReplicaUpdates.writeLock().unlock();
      }
    }
Remove a partition from the map of leader partitions. This method is thread safe.
@param partitionName name of the partition to be removed
ambry-replication/src/main/java/com/github/ambry/replication/ReplicationEngine.java