You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2017/05/12 16:07:54 UTC

kafka git commit: MINOR: Set min isr to avoid race condition in ReplicationBytesIn initialisation

Repository: kafka
Updated Branches:
  refs/heads/trunk e2fafddbb -> 766dea94e


MINOR: Set min isr to avoid race condition in ReplicationBytesIn initialisation

Author: Ismael Juma <is...@juma.me.uk>

Reviewers: Rajini Sivaram <ra...@googlemail.com>

Closes #3033 from ijuma/fix-transient-test-failure-in-test-broker-topic-metrics-bytes-in-out


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/766dea94
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/766dea94
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/766dea94

Branch: refs/heads/trunk
Commit: 766dea94e477a2f84afc57c4d3091ec1688c35c5
Parents: e2fafdd
Author: Ismael Juma <is...@juma.me.uk>
Authored: Fri May 12 16:48:04 2017 +0100
Committer: Ismael Juma <is...@juma.me.uk>
Committed: Fri May 12 16:48:04 2017 +0100

----------------------------------------------------------------------
 core/src/test/scala/unit/kafka/metrics/MetricsTest.scala | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/766dea94/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala b/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
index f33055f..d54e0b3 100644
--- a/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
+++ b/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
@@ -34,6 +34,7 @@ import scala.collection._
 import scala.collection.JavaConverters._
 import scala.util.matching.Regex
 import kafka.consumer.{ConsumerConfig, ZookeeperConsumerConnector}
+import kafka.log.LogConfig
 
 class MetricsTest extends KafkaServerTestHarness with Logging {
   val numNodes = 2
@@ -113,7 +114,9 @@ class MetricsTest extends KafkaServerTestHarness with Logging {
     val bytesIn = s"${BrokerTopicStats.BytesInPerSec},topic=$topic"
     val bytesOut = s"${BrokerTopicStats.BytesOutPerSec},topic=$topic"
 
-    createTopic(zkUtils, topic, 1, numNodes, servers)
+    val topicConfig = new Properties()
+    topicConfig.setProperty(LogConfig.MinInSyncReplicasProp, "2")
+    createTopic(zkUtils, topic, 1, numNodes, servers, topicConfig)
     // Produce a few messages to create the metrics
     TestUtils.produceMessages(servers, topic, nMessages)