hachikuji commented on a change in pull request #8552:
URL: https://github.com/apache/kafka/pull/8552#discussion_r436405820



##########
File path: core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
##########
@@ -423,9 +414,10 @@ class ZkReplicaStateMachine(config: KafkaConfig,
     (result.toMap, partitionsWithNoLeaderAndIsrInZk)
   }
 
-  private def logSuccessfulTransition(logger: StateChangeLogger, replicaId: 
Int, partition: TopicPartition,
+  private def logSuccessfulTransition(traceEnabled: Boolean, logger: 
StateChangeLogger, replicaId: Int, partition: TopicPartition,
                                       currState: ReplicaState, targetState: 
ReplicaState): Unit = {
-    logger.trace(s"Changed state of replica $replicaId for partition 
$partition from $currState to $targetState")
+    if (traceEnabled)

Review comment:
       Seems like we could just get rid of this. The call to `trace` will 
already check `isTraceEnabled` before building the message, so I'm not sure 
we're saving anything.




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

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


Reply via email to