You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/02/26 21:32:00 UTC
[jira] [Commented] (KAFKA-7906) Improve failed leader election
logging
[ https://issues.apache.org/jira/browse/KAFKA-7906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17045920#comment-17045920 ]
ASF GitHub Bot commented on KAFKA-7906:
---------------------------------------
agam commented on pull request #8176: KAFKA-7906: Improve logging for failed leader elections
URL: https://github.com/apache/kafka/pull/8176
- Log election errors within the `kafka.controller` class hierarchy instead of within `state.changed.logger`
- Log failure reason when present
- Verified existing tests pass
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
----------------------------------------------------------------
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:
users@infra.apache.org
> Improve failed leader election logging
> --------------------------------------
>
> Key: KAFKA-7906
> URL: https://issues.apache.org/jira/browse/KAFKA-7906
> Project: Kafka
> Issue Type: Improvement
> Reporter: Jason Gustafson
> Assignee: Agam Brahma
> Priority: Major
>
> We often see annoying log messages like the following in the state change log:
> {code}
> [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)
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)