Details
-
Improvement
-
Status: In Progress
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
We often see annoying log messages like the following in the state change log:
[2019-02-05 00:02:51,307] ERROR [Controller id=13 epoch=14] Controller 13 epoch 14 failed to change state for partition topic-3 from OnlinePartition to OnlinePartition (state.change.logger) kafka.common.StateChangeFailedException: Failed to elect leader for partition topic-3 under strategy PreferredReplicaPartitionLeaderElectionStrategy at kafka.controller.PartitionStateMachine$$anonfun$doElectLeaderForPartitions$3.apply(PartitionStateMachine.scala:328) at kafka.controller.PartitionStateMachine$$anonfun$doElectLeaderForPartitions$3.apply(PartitionStateMachine.scala:326) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at kafka.controller.PartitionStateMachine.doElectLeaderForPartitions(PartitionStateMachine.scala:326) at kafka.controller.PartitionStateMachine.electLeaderForPartitions(PartitionStateMachine.scala:254) at kafka.controller.PartitionStateMachine.doHandleStateChanges(PartitionStateMachine.scala:175) at kafka.controller.PartitionStateMachine.handleStateChanges(PartitionStateMachine.scala:116)
The stack trace is not adding any value and the message doesn't explain why the election failed. You have to read the code to figure it out. It's also curious that you have to look in the state change log for failed leader elections in the first place. It would be more intuitive to put these in the controller log.
Attachments
Issue Links
- links to