You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ch...@apache.org on 2024/09/09 06:02:58 UTC
(kafka) branch 3.7 updated (619aa479635 -> c5b524f0d73)
This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a change to branch 3.7
in repository https://gitbox.apache.org/repos/asf/kafka.git
from 619aa479635 KAFKA-17457 Don't allow ZK migration to start without transactions (#17094) (#17120)
new 6f76ed9a549 KAFKA-16225 [1/N]: Set metadata.log.dir to broker in KRAFT mode in integration test
new c5b524f0d73 MINOR: Remove unwanted debug line in LogDirFailureTest (#15371)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../test/scala/integration/kafka/api/IntegrationTestHarness.scala | 5 +++++
core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
(kafka) 01/02: KAFKA-16225 [1/N]: Set metadata.log.dir to broker in KRAFT mode in integration test
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch 3.7
in repository https://gitbox.apache.org/repos/asf/kafka.git
commit 6f76ed9a549dabfcf77db1ad0264ab20032fa389
Author: Omnia Ibrahim <o....@gmail.com>
AuthorDate: Tue Feb 13 22:13:53 2024 +0000
KAFKA-16225 [1/N]: Set metadata.log.dir to broker in KRAFT mode in integration test
Fix the flakiness of LogDirFailureTest by setting a separate metadata.log.dir for brokers in KRAFT mode.
The test was flaky because as we call causeLogDirFailure some times we impact the first log.dir which also is KafkaConfig.metadataLogDir as we don't have metadata.log.dir. So to fix the flakiness we need to explicitly set metadata.log.dir to diff log dir than the ones we could potentially fail for the tests.
This is part 1 of the fixes. Delivering them separately as the other issues were not as clear cut.
Reviewers: Gaurav Narula <ga...@apple.com>, Justine Olshan <jo...@confluent.io>, Greg Harris <gr...@aiven.io>
---
.../test/scala/integration/kafka/api/IntegrationTestHarness.scala | 5 +++++
core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/core/src/test/scala/integration/kafka/api/IntegrationTestHarness.scala b/core/src/test/scala/integration/kafka/api/IntegrationTestHarness.scala
index 2381976f378..5d3115c98ec 100644
--- a/core/src/test/scala/integration/kafka/api/IntegrationTestHarness.scala
+++ b/core/src/test/scala/integration/kafka/api/IntegrationTestHarness.scala
@@ -70,6 +70,11 @@ abstract class IntegrationTestHarness extends KafkaServerTestHarness {
if (isNewGroupCoordinatorEnabled()) {
cfgs.foreach(_.setProperty(KafkaConfig.NewGroupCoordinatorEnableProp, "true"))
}
+
+ if(isKRaftTest()) {
+ cfgs.foreach(_.setProperty(KafkaConfig.MetadataLogDirProp, TestUtils.tempDir().getAbsolutePath))
+ }
+
insertControllerListenersIfNeeded(cfgs)
cfgs.map(KafkaConfig.fromProps)
}
diff --git a/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala b/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
index c63f4664096..57be102bea0 100644
--- a/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
+++ b/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
@@ -21,7 +21,7 @@ import java.util.Collections
import java.util.concurrent.{ExecutionException, TimeUnit}
import kafka.api.IntegrationTestHarness
import kafka.controller.{OfflineReplica, PartitionAndReplica}
-import kafka.utils.TestUtils.{waitUntilTrue, Checkpoint, LogDirFailureType, Roll}
+import kafka.utils.TestUtils.{Checkpoint, LogDirFailureType, Roll, waitUntilTrue}
import kafka.utils.{CoreUtils, Exit, TestInfoUtils, TestUtils}
import org.apache.kafka.clients.consumer.Consumer
import org.apache.kafka.clients.producer.{ProducerConfig, ProducerRecord}
@@ -56,6 +56,7 @@ class LogDirFailureTest extends IntegrationTestHarness {
override def setUp(testInfo: TestInfo): Unit = {
super.setUp(testInfo)
createTopic(topic, partitionNum, brokerCount)
+ ensureConsistentKRaftMetadata()
}
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@@ -168,6 +169,10 @@ class LogDirFailureTest extends IntegrationTestHarness {
}
def testProduceAfterLogDirFailureOnLeader(failureType: LogDirFailureType, quorum: String): Unit = {
+ if (isKRaftTest()) {
+ val value = configs.map(c => c.brokerId -> c.logDirs.contains(c.metadataLogDir))
+ logger.warn(s">>>>>> ${value.mkString(",")}")
+ }
val consumer = createConsumer()
subscribeAndWaitForAssignment(topic, consumer)
(kafka) 02/02: MINOR: Remove unwanted debug line in LogDirFailureTest (#15371)
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch 3.7
in repository https://gitbox.apache.org/repos/asf/kafka.git
commit c5b524f0d73ba80c576585299cc3cf9ae0a7fcab
Author: Omnia Ibrahim <o....@gmail.com>
AuthorDate: Tue Feb 20 10:25:17 2024 +0000
MINOR: Remove unwanted debug line in LogDirFailureTest (#15371)
Reviewers: Mickael Maison <mi...@gmail.com>, Justine Olshan <jo...@confluent.io>, Igor Soarez <so...@apple.com>
---
core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala | 4 ----
1 file changed, 4 deletions(-)
diff --git a/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala b/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
index 57be102bea0..54a10d78c76 100644
--- a/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
+++ b/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
@@ -169,10 +169,6 @@ class LogDirFailureTest extends IntegrationTestHarness {
}
def testProduceAfterLogDirFailureOnLeader(failureType: LogDirFailureType, quorum: String): Unit = {
- if (isKRaftTest()) {
- val value = configs.map(c => c.brokerId -> c.logDirs.contains(c.metadataLogDir))
- logger.warn(s">>>>>> ${value.mkString(",")}")
- }
val consumer = createConsumer()
subscribeAndWaitForAssignment(topic, consumer)