Updated Branches:
refs/heads/0.8 1cb217579 -> f53fe1836
kafka-1069; MBean kafka.cluster.Partition report wrong UnderReplicated status; patched by
Jun Rao; reviewed by Neha Narkhede
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/f53fe183
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/f53fe183
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/f53fe183
Branch: refs/heads/0.8
Commit: f53fe18361a434c388e88b0eed90b8faa0983fd8
Parents: 1cb2175
Author: Jun Rao <junrao@gmail.com>
Authored: Tue Oct 8 09:12:28 2013 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Tue Oct 8 09:12:28 2013 -0700
----------------------------------------------------------------------
core/src/main/scala/kafka/cluster/Partition.scala | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/f53fe183/core/src/main/scala/kafka/cluster/Partition.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/cluster/Partition.scala b/core/src/main/scala/kafka/cluster/Partition.scala
index a9bb3c8..60f3ed4 100644
--- a/core/src/main/scala/kafka/cluster/Partition.scala
+++ b/core/src/main/scala/kafka/cluster/Partition.scala
@@ -69,7 +69,12 @@ class Partition(val topic: String,
def isUnderReplicated(): Boolean = {
leaderIsrUpdateLock synchronized {
- inSyncReplicas.size < replicationFactor
+ leaderReplicaIfLocal() match {
+ case Some(_) =>
+ inSyncReplicas.size < replicationFactor
+ case None =>
+ false
+ }
}
}
|