You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "hachikuji (via GitHub)" <gi...@apache.org> on 2023/05/30 17:41:54 UTC

[GitHub] [kafka] hachikuji commented on a diff in pull request #13780: KAFKA-15039: Reduce logging level to trace in PartitionChangeBuilder.…

hachikuji commented on code in PR #13780:
URL: https://github.com/apache/kafka/pull/13780#discussion_r1210611871


##########
metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java:
##########
@@ -220,13 +220,15 @@ private boolean isValidNewLeader(int replica) {
     private void tryElection(PartitionChangeRecord record) {
         ElectionResult electionResult = electLeader();
         if (electionResult.node != partition.leader) {
-            log.debug(
-                "Setting new leader for topicId {}, partition {} to {} using {} election",
-                topicId,
-                partitionId,
-                electionResult.node,
-                electionResult.unclean ? "an unclean" : "a clean"
-            );
+            if (log.isTraceEnabled()) {
+                log.trace(
+                    "Setting new leader for topicId {}, partition {} to {} using {} election",
+                    topicId,
+                    partitionId,
+                    electionResult.node,
+                    electionResult.unclean ? "an unclean" : "a clean"

Review Comment:
   I wonder if it would make sense to log unclean elections at a higher level?



-- 
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-unsubscribe@kafka.apache.org

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