int getTopicEffectiveMinIsr(String topicName) {
        int currentMinIsr = defaultMinIsr;
        String minIsrConfig = configurationControl.getTopicConfig(topicName, MIN_IN_SYNC_REPLICAS_CONFIG);
        if (minIsrConfig != null) {
            currentMinIsr = Integer.parseInt(minIsrConfig);
        } else {
            log.debug("Can't find the min isr config for topic: " + topicName + ". Use default value " + defaultMinIsr);
        }
        
        Uuid topicId = topicsByName.get(topicName);
        int replicationFactor = topics.get(topicId).parts.get(0).replicas.length;
        return Math.min(currentMinIsr, replicationFactor);
    }
@Test
    public void testEligibleLeaderReplicas_EffectiveMinIsr() {
        ReplicationControlTestContext ctx = new ReplicationControlTestContext.Builder().setIsElrEnabled(true).build();
        ReplicationControlManager replicationControl = ctx.replicationControl;
        ctx.registerBrokers(0, 1, 2);
        ctx.unfenceBrokers(0, 1, 2);
        CreatableTopicResult createTopicResult = ctx.createTestTopic("foo",
                new int[][]{new int[]{0, 1, 2}});

        TopicIdPartition topicIdPartition = new TopicIdPartition(createTopicResult.topicId(), 0);
        assertEquals(OptionalInt.of(0), ctx.currentLeader(topicIdPartition));
        ctx.alterTopicConfig("foo", TopicConfig.MIN_IN_SYNC_REPLICAS_CONFIG, "5");
        assertEquals(3, replicationControl.getTopicEffectiveMinIsr("foo"));
    }