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 2013/06/24 07:03:46 UTC
[1/2] git commit: kafka-951;
Leader election rate may be reported on a non-controller; patched by Jun Rao;
reviewed by Swapnil Ghike
Updated Branches:
refs/heads/0.8 cc6027b32 -> 5f14a69c2
kafka-951; Leader election rate may be reported on a non-controller; patched by Jun Rao; reviewed by Swapnil Ghike
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/5a084f7b
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/5a084f7b
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/5a084f7b
Branch: refs/heads/0.8
Commit: 5a084f7be6986ccbe6ede9df0b519d0fd7929d01
Parents: cc6027b
Author: Jun Rao <ju...@gmail.com>
Authored: Sun Jun 23 22:03:14 2013 -0700
Committer: Jun Rao <ju...@gmail.com>
Committed: Sun Jun 23 22:03:14 2013 -0700
----------------------------------------------------------------------
.../main/scala/kafka/controller/ReplicaStateMachine.scala | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/5a084f7b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
index 4fbb28e..0c9d436 100644
--- a/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
+++ b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
@@ -248,10 +248,10 @@ class ReplicaStateMachine(controller: KafkaController) extends Logging {
class BrokerChangeListener() extends IZkChildListener with Logging {
this.logIdent = "[BrokerChangeListener on Controller " + controller.config.brokerId + "]: "
def handleChildChange(parentPath : String, currentBrokerList : java.util.List[String]) {
- ControllerStats.leaderElectionTimer.time {
- info("Broker change listener fired for path %s with children %s".format(parentPath, currentBrokerList.mkString(",")))
- controllerContext.controllerLock synchronized {
- if (hasStarted.get) {
+ info("Broker change listener fired for path %s with children %s".format(parentPath, currentBrokerList.mkString(",")))
+ controllerContext.controllerLock synchronized {
+ if (hasStarted.get) {
+ ControllerStats.leaderElectionTimer.time {
try {
val curBrokerIds = currentBrokerList.map(_.toInt).toSet
val newBrokerIds = curBrokerIds -- controllerContext.liveOrShuttingDownBrokerIds
[2/2] git commit: kafka-950;
Leader election rate may be reported on a non-controller; patched by Jun Rao;
reviewed by Sriram Subramanian
Posted by ju...@apache.org.
kafka-950; Leader election rate may be reported on a non-controller; patched by Jun Rao; reviewed by Sriram Subramanian
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/5f14a69c
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/5f14a69c
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/5f14a69c
Branch: refs/heads/0.8
Commit: 5f14a69c2e5c21be9b1257e62040e89f400ac2d9
Parents: 5a084f7
Author: Jun Rao <ju...@gmail.com>
Authored: Sun Jun 23 22:04:46 2013 -0700
Committer: Jun Rao <ju...@gmail.com>
Committed: Sun Jun 23 22:04:46 2013 -0700
----------------------------------------------------------------------
core/src/main/scala/kafka/log/LogSegment.scala | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/5f14a69c/core/src/main/scala/kafka/log/LogSegment.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/log/LogSegment.scala b/core/src/main/scala/kafka/log/LogSegment.scala
index 8cc1c94..6f11a8b 100644
--- a/core/src/main/scala/kafka/log/LogSegment.scala
+++ b/core/src/main/scala/kafka/log/LogSegment.scala
@@ -147,6 +147,7 @@ class LogSegment(val messageSet: FileMessageSet,
messageSet.truncateTo(mapping.position)
if (messageSet.sizeInBytes == 0)
firstAppendTime = None
+ bytesSinceLastIndexEntry = 0
}
/**