From b4035610b8ec77ab152c89a655f3ba0453c39cdd Mon Sep 17 00:00:00 2001 From: Guozhang Wang Date: Mon, 23 Sep 2019 09:24:32 -0700 Subject: [PATCH] KAFKA-8086: Use 1 partition for offset topic when possible (#7356) I realized some flaky tests failed at setup or calls that tries to create offset topics, and I think using one partition and one replica would be sufficient in these cases. Reviewers: Bill Bejeck --- .../integration/kafka/api/AuthorizerIntegrationTest.scala | 1 + .../kafka/network/DynamicConnectionQuotaTest.scala | 4 ---- .../test/scala/unit/kafka/server/MetadataRequestTest.scala | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala index af007da962d..01021fce16a 100644 --- a/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala +++ b/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala @@ -132,6 +132,7 @@ class AuthorizerIntegrationTest extends BaseRequestTest { properties.put(KafkaConfig.AuthorizerClassNameProp, classOf[SimpleAclAuthorizer].getName) properties.put(KafkaConfig.BrokerIdProp, brokerId.toString) properties.put(KafkaConfig.OffsetsTopicPartitionsProp, "1") + properties.put(KafkaConfig.OffsetsTopicReplicationFactorProp, "1") properties.put(KafkaConfig.TransactionsTopicPartitionsProp, "1") properties.put(KafkaConfig.TransactionsTopicReplicationFactorProp, "1") properties.put(KafkaConfig.TransactionsTopicMinISRProp, "1") diff --git a/core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala b/core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala index 871953addd3..16e3cbc9260 100644 --- a/core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala +++ b/core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala @@ -65,10 +65,6 @@ class DynamicConnectionQuotaTest extends BaseRequestTest { } } - override protected def brokerPropertyOverrides(properties: Properties): Unit = { - super.brokerPropertyOverrides(properties) - } - @Test def testDynamicConnectionQuota(): Unit = { val maxConnectionsPerIP = 5 diff --git a/core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala b/core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala index c51444cbe9d..2b3f3218190 100644 --- a/core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala +++ b/core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala @@ -36,6 +36,7 @@ import scala.collection.Seq class MetadataRequestTest extends BaseRequestTest { override def brokerPropertyOverrides(properties: Properties): Unit = { + properties.setProperty(KafkaConfig.OffsetsTopicPartitionsProp, "1") properties.setProperty(KafkaConfig.DefaultReplicationFactorProp, "2") properties.setProperty(KafkaConfig.RackProp, s"rack/${properties.getProperty(KafkaConfig.BrokerIdProp)}") }