You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ju...@apache.org on 2017/10/16 21:21:37 UTC
kafka git commit: MINOR: reduce partition state machine debug logging
Repository: kafka
Updated Branches:
refs/heads/1.0 a2a1226b6 -> dc6bfa553
MINOR: reduce partition state machine debug logging
PartitionStateMachine.electLeaderForPartition logs all partition states in the cluster. This leads to quadratic logging behavior since PartitionStateMachine.electLeaderForPartition itself gets called on a per-partition basis.
This patch reduces the logging so that only the single partition undergoing leader election gets its state logged.
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/dc6bfa55
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/dc6bfa55
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/dc6bfa55
Branch: refs/heads/1.0
Commit: dc6bfa553e73ffccd1e604963e076c78d8ddcd69
Parents: a2a1226
Author: Onur Karaman <ok...@linkedin.com>
Authored: Mon Oct 16 10:36:16 2017 -0700
Committer: Onur Karaman <ok...@linkedin.com>
Committed: Mon Oct 16 10:36:20 2017 -0700
----------------------------------------------------------------------
core/src/main/scala/kafka/controller/PartitionStateMachine.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/dc6bfa55/core/src/main/scala/kafka/controller/PartitionStateMachine.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/controller/PartitionStateMachine.scala b/core/src/main/scala/kafka/controller/PartitionStateMachine.scala
index 9e75bc0..97f64c4 100755
--- a/core/src/main/scala/kafka/controller/PartitionStateMachine.scala
+++ b/core/src/main/scala/kafka/controller/PartitionStateMachine.scala
@@ -323,7 +323,7 @@ class PartitionStateMachine(controller: KafkaController, stateChangeLogger: Stat
stateChangeLog.error(failMsg)
throw new StateChangeFailedException(stateChangeLog.messageWithPrefix(failMsg), sce)
}
- debug(s"After leader election, leader cache is updated to ${controllerContext.partitionLeadershipInfo}")
+ debug(s"After leader election, leader cache for $topicAndPartition is updated to ${controllerContext.partitionLeadershipInfo(topicAndPartition)}")
}
private def getLeaderIsrAndEpochOrThrowException(topic: String, partition: Int): LeaderIsrAndControllerEpoch = {