kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject [1/4] git commit: kafka-1069; MBean kafka.cluster.Partition report wrong UnderReplicated status; patched by Jun Rao; reviewed by Neha Narkhede
Date Tue, 08 Oct 2013 20:13:14 GMT
Updated Branches:
  refs/heads/trunk bfc4ba499 -> 343a1e266


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/trunk
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
+      }
     }
   }
 


Mime
View raw message