jsancio commented on code in PR #15529:
URL: https://github.com/apache/kafka/pull/15529#discussion_r1523660494


##########
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java:
##########
@@ -2189,7 +2189,7 @@ int getTopicEffectiveMinIsr(String topicName) {
         if (minIsrConfig != null) {
             currentMinIsr = Integer.parseInt(minIsrConfig);
         } else {
-            log.warn("Can't find the min isr config for topic: " + topicName + 
" using default value " + defaultMinIsr);
+            log.debug("Can't find the min isr config for topic: " + topicName 
+ " using default value " + defaultMinIsr);

Review Comment:
   This comment is for the `log.warn` message in line 2200.
   
   What exception are you trying to catch exactly? Is it a 
`NullPointerException`? If so, shouldn't we throw the exception up the stack? 
Based on the code I would assume that if there is an error it means that the 
controller is trying to find the replication factor for a topic and doesn't 
exists, no?
   
   If you decide to keep the log message, lets log the exception instead of 
logging the exception's `toString`.
   ```java
   log.warn("Can't find the replication factor for topic: " + topicName + " 
using default value " + replicationFactor, e);
   ```



-- 
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