CalvinConfluent commented on code in PR #14312:
URL: https://github.com/apache/kafka/pull/14312#discussion_r1361389729


##########
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java:
##########
@@ -1995,6 +2015,19 @@ private void 
listReassigningTopic(ListPartitionReassignmentsResponseData respons
             setReplicas(Replicas.toList(partition.replicas)));
     }
 
+    // Visible to test.
+    Integer getTopicEffectiveMinIsr(String topicName) {
+        String minIsrConfig = configurationControl.getTopicConfig(topicName, 
MIN_IN_SYNC_REPLICAS_CONFIG);
+        Integer currentMinIsr = minIsrConfig.isEmpty() ? defaultMinIsr : 
Integer.parseInt(minIsrConfig);
+        Uuid topicId = topicsByName.get(topicName);
+        Integer replicationFactor = 
topics.get(topicId).parts.get(0).replicas.length;

Review Comment:
   Yeah, from the current use case, the caller side has validated the topic. 
However, I think we can be paranoid here to have a try-catch to avoid mistakes 
as there are a lot of places can hit null. 
   @mumrah You commented on this before, what do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to