private void tryElectLeader(TopicPartition topicPartition) {
        // only use deadlineNs, so it's ok to use null for other params
        ControllerRequestContext context = new ControllerRequestContext(null, null, OptionalLong.empty());
        ElectLeadersRequestData data = new ElectLeadersRequestData();
        TopicPartitions topicPartitions = new TopicPartitions();
        topicPartitions.setTopic(topicPartition.topic());
        topicPartitions.partitions().add(topicPartition.partition());
        data.setTopicPartitions(new ElectLeadersRequestData.TopicPartitionsCollection(Collections.singletonList(topicPartitions).listIterator()));
        quorumController.electLeaders(context, data).whenComplete((resp, ex) -> {
            if (ex != null) {
                log.warn("force elect partition[{}] leader fail", topicPartition, ex);
            } else {
                log.info("force elect partition[{}] leader done, response[{}]", topicPartition, resp);
            }
        });
        log.info("partition[{}] reassignment re-elect leader timeout, force async elect leader again", topicPartition);
    }
Add partition to re-elect leader timeout.
Generally, this method is invoked to ensure that the partition leader can be re-elected even if the original broker is out of communication.
@param topicPartition the topic partition that needs to be re-elected
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java