Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor integration and system tests to remove Zookeeper, add group protocol parameter #17581

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
965ff03
Upgraded ConsumerWithLegacyMessageFormatIntegrationTest
kirktrue Oct 22, 2024
753626a
Update LogAppendTimeTest.scala
kirktrue Oct 22, 2024
270fde8
Update FetchFromFollowerIntegrationTest.scala
kirktrue Oct 22, 2024
4277b23
Update RemoteTopicCrudTest.scala
kirktrue Oct 22, 2024
61fec39
Update ListOffsetsIntegrationTest.scala
kirktrue Oct 22, 2024
cb06a79
Updating BaseProducerSendTest and its subclass PlaintextProducerSendTest
kirktrue Oct 22, 2024
9a46023
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Oct 23, 2024
18d46e8
Updates to reduce boilerplate
kirktrue Oct 23, 2024
1f6b564
Removed more uses of "zk" as a quorum test parameter
kirktrue Oct 23, 2024
c1df673
More clean up to remove ZK tests
kirktrue Oct 23, 2024
322aeb9
Updates for more tests
kirktrue Oct 24, 2024
b52488c
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Oct 24, 2024
eabc67c
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Oct 24, 2024
c789dfb
The Great Migration
kirktrue Oct 25, 2024
36535c6
Fixed whitespace change
kirktrue Oct 25, 2024
6400957
Reverted removal of @nowarn
kirktrue Oct 25, 2024
7f0e4a1
Temporarily added getTestQuorumAndGroupProtocolParametersClassicGroup…
kirktrue Oct 25, 2024
e3e2c8c
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Oct 25, 2024
a7dd66c
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Oct 28, 2024
999c528
Support for changing the group.protocol from the default and removing…
kirktrue Oct 29, 2024
1252f08
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Oct 29, 2024
28248e9
WIP system test updates
kirktrue Oct 29, 2024
c02835e
Whitespace and other minor-ish changes
kirktrue Oct 29, 2024
e0900f5
Reverting tests to allow them to fail
kirktrue Oct 29, 2024
8d80b63
Hopefully that's obvious enough :)
kirktrue Oct 30, 2024
a113f6b
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Oct 31, 2024
46c6f4a
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Nov 1, 2024
f03f28c
Merge branch 'trunk' into kirktrue-remove-zookeeper-tests-part-1
kirktrue Nov 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,29 @@ public class ConsumerConfig extends AbstractConfig {
* <code>group.protocol</code>
*/
public static final String GROUP_PROTOCOL_CONFIG = "group.protocol";
public static final String DEFAULT_GROUP_PROTOCOL = GroupProtocol.CLASSIC.name().toLowerCase(Locale.ROOT);

// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
// THIS CHANGE IS TEMPORARY vvvvvvvv
public static final String DEFAULT_GROUP_PROTOCOL = GroupProtocol.CONSUMER.name().toLowerCase(Locale.ROOT);
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^
// THIS CHANGE IS TEMPORARY ^^^^^^^^

public static final String GROUP_PROTOCOL_DOC = "The group protocol consumer should use. We currently " +
"support \"classic\" or \"consumer\". If \"consumer\" is specified, then the consumer group protocol will be " +
"used. Otherwise, the classic group protocol will be used.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testListMaxTimestampWithEmptyLog(quorum: String): Unit = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the proper change here to remove the quorum parameter entirely?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd wondered that and wanted someone to raise the question.

I think it makes sense to remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to oblige :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question out to @cmccabe regarding his preference.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestInfoUtils uses the parameters to determine if it isKraft(), isZkMigrationTest(), etc. Usages of those methods would need to be updated too.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm sure, but wouldn't AK 4.0 have all of the ZK migration tests removed, and wouldn't all tests be ZK?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some shenanigans done in the base test classes regarding the quorum param. Until we remove the ZK bits from that test infra, I think we actually need the quorum param :-/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve of the use of "shenanigans" to describe this 👍

val maxTimestampOffset = runFetchOffsets(adminClient, OffsetSpec.maxTimestamp(), topicName)
assertEquals(ListOffsetsResponse.UNKNOWN_OFFSET, maxTimestampOffset.offset())
Expand All @@ -88,7 +88,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {


@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testThreeCompressedRecordsInOneBatch(quorum: String): Unit = {
produceMessagesInOneBatch("gzip")
verifyListOffsets()
Expand All @@ -102,7 +102,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testThreeNonCompressedRecordsInOneBatch(quorum: String): Unit = {
produceMessagesInOneBatch()
verifyListOffsets()
Expand All @@ -117,7 +117,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testThreeNonCompressedRecordsInSeparateBatch(quorum: String): Unit = {
produceMessagesInSeparateBatch()
verifyListOffsets()
Expand Down Expand Up @@ -162,7 +162,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testThreeRecordsInOneBatchHavingDifferentCompressionTypeWithServer(quorum: String): Unit = {
val props: Properties = new Properties()
props.setProperty(TopicConfig.COMPRESSION_TYPE_CONFIG, "lz4")
Expand All @@ -172,7 +172,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testThreeRecordsInSeparateBatchHavingDifferentCompressionTypeWithServer(quorum: String): Unit = {
val props: Properties = new Properties()
props.setProperty(TopicConfig.COMPRESSION_TYPE_CONFIG, "lz4")
Expand All @@ -182,7 +182,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testThreeCompressedRecordsInSeparateBatch(quorum: String): Unit = {
produceMessagesInSeparateBatch("gzip")
verifyListOffsets()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testCreateRemoteTopicWithValidRetentionTime(quorum: String): Unit = {
val topicConfig = new Properties()
topicConfig.put(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "true")
Expand All @@ -86,7 +86,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testCreateRemoteTopicWithValidRetentionSize(quorum: String): Unit = {
val topicConfig = new Properties()
topicConfig.put(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "true")
Expand All @@ -98,7 +98,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testCreateRemoteTopicWithInheritedLocalRetentionTime(quorum: String): Unit = {
// inherited local retention ms is 1000
val topicConfig = new Properties()
Expand All @@ -110,7 +110,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testCreateRemoteTopicWithInheritedLocalRetentionSize(quorum: String): Unit = {
// inherited local retention bytes is 1024
val topicConfig = new Properties()
Expand All @@ -122,7 +122,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testCreateRemoteTopicWithInvalidRetentionTime(quorum: String): Unit = {
// inherited local retention ms is 1000
val topicConfig = new Properties()
Expand All @@ -134,7 +134,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testCreateRemoteTopicWithInvalidRetentionSize(quorum: String): Unit = {
// inherited local retention bytes is 1024
val topicConfig = new Properties()
Expand All @@ -146,7 +146,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testCreateCompactedRemoteStorage(quorum: String): Unit = {
val topicConfig = new Properties()
topicConfig.put(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "true")
Expand Down Expand Up @@ -301,7 +301,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testEnableRemoteLogOnExistingTopicTest(quorum: String): Unit = {
val admin = createAdminClient()
val topicConfig = new Properties()
Expand All @@ -319,7 +319,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testEnableRemoteLogWhenSystemRemoteStorageIsDisabled(quorum: String): Unit = {
val admin = createAdminClient()

Expand All @@ -343,7 +343,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testUpdateTopicConfigWithValidRetentionTimeTest(quorum: String): Unit = {
val admin = createAdminClient()
val topicConfig = new Properties()
Expand All @@ -364,7 +364,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testUpdateTopicConfigWithValidRetentionSizeTest(quorum: String): Unit = {
val admin = createAdminClient()
val topicConfig = new Properties()
Expand All @@ -385,7 +385,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testUpdateTopicConfigWithInheritedLocalRetentionTime(quorum: String): Unit = {
val admin = createAdminClient()
val topicConfig = new Properties()
Expand All @@ -405,7 +405,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testUpdateTopicConfigWithInheritedLocalRetentionSize(quorum: String): Unit = {
val admin = createAdminClient()
val topicConfig = new Properties()
Expand Down Expand Up @@ -474,7 +474,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testTopicDeletion(quorum: String): Unit = {
MyRemoteStorageManager.deleteSegmentEventCounter.set(0)
val numPartitions = 2
Expand All @@ -493,7 +493,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testClusterWideDisablementOfTieredStorageWithEnabledTieredTopic(quorum: String): Unit = {
val topicConfig = new Properties()
topicConfig.setProperty(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "true")
Expand All @@ -515,7 +515,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}

@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
@ValueSource(strings = Array("kraft"))
def testClusterWithoutTieredStorageStartsSuccessfullyIfTopicWithTieringDisabled(quorum: String): Unit = {
val topicConfig = new Properties()
topicConfig.setProperty(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, false.toString)
Expand Down
Loading
Loading