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

chore: bump E2E tests for Kafka 3.7 #544

Merged
merged 6 commits into from May 22, 2024

Conversation

jeqo
Copy link
Contributor

@jeqo jeqo commented May 10, 2024

Kafka 3.7 have changed how local retention affects active segment: from now on, if local retention time is passed, then a new (empty) active segment is rollout.
This changes how the end-to-end tests validated deletion by retention.

Apart from this change, the PR includes some e2e test improvements: adding docs to make the sequence of steps on the end-to-end test easier to follow; some reorganization and renaming with the same purpose. See the commits for more detail.

@jeqo jeqo force-pushed the jeqo/bump-e2e-kafka-3.7 branch 3 times, most recently from 6a70a49 to c38861c Compare May 15, 2024 12:06
@jeqo jeqo changed the title [chore] Bump E2E tests for Kafka 3.7 chore: bump E2E tests for Kafka 3.7 May 15, 2024
Comment on lines -530 to +588
final ConsumerRecord<byte[], byte[]> record = consumer.poll(Duration.ofSeconds(1)).records(TP_0_0).get(0);
assertThat(record.offset()).isEqualTo(newStartOffset);

consumer.seekToBeginning(List.of(TP_0_0));

// with current retention logic, active segment is rotated, and no data is available locally.
final List<ConsumerRecord<byte[], byte[]>> records = consumer.poll(Duration.ofSeconds(1)).records(TP_0_0);
assertThat(records).isEmpty();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Main change: validating that the active segment is not rotated is not correct anymore.

@jeqo jeqo force-pushed the jeqo/bump-e2e-kafka-3.7 branch 2 times, most recently from d7548eb to 730adc4 Compare May 15, 2024 19:07
@@ -49,7 +49,7 @@ public class RemoteLogMetadataTracker {
private static final String REMOTE_LOG_METADATA_TOPIC = "__remote_log_metadata";

private final KafkaConsumer<byte[], RemoteLogMetadata> consumer;
private List<TopicPartition> partitions;
private List<TopicPartition> metadataPartitions;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Separating "metadata" from "user" partitions.

@jeqo jeqo marked this pull request as ready for review May 15, 2024 19:15
@jeqo jeqo requested a review from a team as a code owner May 15, 2024 19:15
@@ -94,21 +109,23 @@ abstract class SingleBrokerTest {
static final TopicPartition TP_0_0 = new TopicPartition(TOPIC_0, 0);
static final TopicPartition TP_0_1 = new TopicPartition(TOPIC_0, 1);
static final TopicPartition TP_1_0 = new TopicPartition(TOPIC_1, 0);
static final List<TopicPartition> TOPIC_PARTITIONS = List.of(TP_0_0, TP_0_1, TP_1_0);
static final List<TopicPartition> USER_TOPIC_PARTITIONS = List.of(TP_0_0, TP_0_1, TP_1_0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here, separating "metadata" from "user" partitions

* from remote storage</li>
* <li>{@link SingleBrokerTest#remoteCleanupDueToRetention()}: wait for retention by size to remove data
* from remote storage</li>
* <li>{@link SingleBrokerTest#topicDelete()}: (unsupported) delete topic and validate data is removed
Copy link
Contributor

Choose a reason for hiding this comment

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

unsupported == not implemented yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, it should be implemented eventually: https://issues.apache.org/jira/browse/KAFKA-15166

@jeqo jeqo requested a review from giuseppelillo May 16, 2024 21:11
@jeqo jeqo force-pushed the jeqo/bump-e2e-kafka-3.7 branch 2 times, most recently from b1e47e4 to c66e109 Compare May 20, 2024 08:10
@jeqo jeqo force-pushed the jeqo/bump-e2e-kafka-3.7 branch from c66e109 to bb6d8b3 Compare May 20, 2024 08:58
@giuseppelillo giuseppelillo merged commit fd5b0e0 into Aiven-Open:main May 22, 2024
9 checks passed
@jeqo jeqo deleted the jeqo/bump-e2e-kafka-3.7 branch May 22, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants