This is an automated email from the ASF dual-hosted git repository.
dajac pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new e5598a9d8c7 KAFKA-18040; fix for test that ensures produce during
follower shutdown (#18108)
e5598a9d8c7 is described below
commit e5598a9d8c7ec134740af48911cc60e72bf638eb
Author: Kirk True <[email protected]>
AuthorDate: Mon Dec 9 23:01:51 2024 -0800
KAFKA-18040; fix for test that ensures produce during follower shutdown
(#18108)
Test lacked the proper configuration for the offset topic replication. As a
result, when the follower was shut down, the coordinator did not failover
properly.
Reviewers: TaiJuWu <[email protected]>, David Jacot <[email protected]>
---
core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala | 4 +++-
core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala | 1 -
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git
a/core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala
b/core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala
index be853d9d990..99aefe0e51b 100644
--- a/core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala
+++ b/core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala
@@ -34,6 +34,7 @@ import org.apache.kafka.common.network.{ConnectionMode,
ListenerName}
import org.apache.kafka.common.record.TimestampType
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.{KafkaException, TopicPartition}
+import org.apache.kafka.coordinator.group.GroupCoordinatorConfig
import org.apache.kafka.server.config.ServerLogConfigs
import org.junit.jupiter.api.Assertions._
import org.junit.jupiter.api.{AfterEach, BeforeEach, TestInfo}
@@ -50,6 +51,7 @@ abstract class BaseProducerSendTest extends
KafkaServerTestHarness {
def generateConfigs: scala.collection.Seq[KafkaConfig] = {
val overridingProps = new Properties()
val numServers = 2
+
overridingProps.put(GroupCoordinatorConfig.OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG,
2.toShort)
overridingProps.put(ServerLogConfigs.NUM_PARTITIONS_CONFIG, 4.toString)
TestUtils.createBrokerConfigs(
numServers,
@@ -367,7 +369,7 @@ abstract class BaseProducerSendTest extends
KafkaServerTestHarness {
}
@ParameterizedTest(name =
TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
-
@MethodSource(Array("getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_16176"))
+ @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
def testSendToPartitionWithFollowerShutdownShouldNotTimeout(quorum: String,
groupProtocol: String): Unit = {
// This test produces to a leader that has follower that is shutting down.
It shows that
// the produce request succeed, do not timeout and do not need to be
retried.
diff --git
a/core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala
b/core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala
index f4d6816da8c..ac59f026b0c 100755
--- a/core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala
+++ b/core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala
@@ -575,7 +575,6 @@ object QuorumTestHarness {
// The following parameter groups are to *temporarily* avoid bugs with the
CONSUMER group protocol Consumer
// implementation that would otherwise cause tests to fail.
- def
getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_16176:
stream.Stream[Arguments] =
getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly
def
getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_17960:
stream.Stream[Arguments] =
getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly
def
getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_17961:
stream.Stream[Arguments] =
getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly
def
getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_17964:
stream.Stream[Arguments] =
getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly