Chia-Ping Tsai created KAFKA-21266:
--------------------------------------

             Summary: getTopicEffectiveMinIsr should take the replicas from the 
target partition
                 Key: KAFKA-21266
                 URL: https://issues.apache.org/jira/browse/KAFKA-21266
             Project: Kafka
          Issue Type: Bug
            Reporter: Chia-Ping Tsai
            Assignee: Chia-Ping Tsai


{code:java}
    int getTopicEffectiveMinIsr(String topicName) {
        String minIsrConfig = configurationControl.getTopicConfig(topicName, 
MIN_IN_SYNC_REPLICAS_CONFIG).value();
        int currentMinIsr = Integer.parseInt(minIsrConfig);
        Uuid topicId = topicsByName.get(topicName);
        int replicationFactor = 
topics.get(topicId).parts.get(0).replicas.length;
        return Math.min(currentMinIsr, replicationFactor);
    } {code}
Since each partition is allowed to have different replicas, the incorrect 
replica number could clear the ELR unexpectedly. For example, the first 
partition has only 1 replica, so the controller assumes the HW can be advanced 
(due to min ISR = 1) and clears the ELR set.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to