Skip to content

KAFKA-19306: Migrate LogCompactionTester to tools module #19905

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

Open
wants to merge 12 commits into
base: trunk
Choose a base branch
from

Conversation

yunchipang
Copy link
Contributor

@yunchipang yunchipang commented Jun 4, 2025

jira: KAFKA-19306

log

Producing 1000000 messages..to topics
log-cleaner-test--1726257157227544436-0
Logging produce requests to
/tmp/kafka-log-cleaner-produced-4277333202437782857.txt
Sleeping for 20seconds...
Consuming messages...
Logging consumed messages to
/tmp/kafka-log-cleaner-consumed-5119667275442624588.txt
1000000 rows of data produced, 120194 rows of data consumed (88.0%
reduction).
De-duplicating and validating output files...
Validated 90157 values, 0 mismatches.
Data verification is completed

result

================================================================================
SESSION REPORT (ALL TESTS)
ducktape version: 0.12.0
session_id:       2025-06-27--001
run time:         1 minute 3.622 seconds
tests run:        1
passed:           1
flaky:            0
failed:           0
ignored:          0
================================================================================
test_id:
kafkatest.tests.tools.log_compaction_test.LogCompactionTest.test_log_compaction.metadata_quorum=ISOLATED_KRAFT
status:     PASS
run time:   1 minute 3.307 seconds
--------------------------------------------------------------------------------

@github-actions github-actions bot added triage PRs from the community tools build Gradle build or GitHub Actions labels Jun 4, 2025
@github-actions github-actions bot added core Kafka Broker tests Test fixes (including flaky tests) labels Jun 5, 2025
Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

@yunchipang yunchipang force-pushed the KAFKA-19306-migrate-LogCompactionTester-to-tools-module branch from c68abe6 to c0ec2b9 Compare June 17, 2025 02:25
@yunchipang yunchipang force-pushed the KAFKA-19306-migrate-LogCompactionTester-to-tools-module branch 2 times, most recently from 715b34a to bba76b2 Compare June 18, 2025 02:07
Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

* Then we compare the final message in both logs for each key. If this final message is not the same for all keys we
* print an error and exit with exit code 1, otherwise we print the size reduction and exit with exit code 0.
*/
public class LogCompactionTester {
Copy link
Member

Choose a reason for hiding this comment

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

the e2e don't include the test jar of tools module, which results in no class error when running log_compaction_test.py. Given that ClientCompatibilityTest is in production code, it should be fine to move LogCompactionTester to production code also.

@github-actions github-actions bot removed needs-attention triage PRs from the community labels Jun 23, 2025
@yunchipang yunchipang force-pushed the KAFKA-19306-migrate-LogCompactionTester-to-tools-module branch from c1fbd3a to 267ac01 Compare June 24, 2025 04:32
@yunchipang yunchipang marked this pull request as ready for review June 25, 2025 00:27
@yunchipang
Copy link
Contributor Author

@chia7712 can you have a look? thanks!
image

@TaiJuWu
Copy link
Collaborator

TaiJuWu commented Jun 25, 2025

@yunchipang Please merge trunk and fix the build error.

@yunchipang yunchipang requested a review from chia7712 June 28, 2025 17:54
Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@yunchipang thanks for this patch. It seems to me splitting the scala file to 4 java files are unnecessary.

import java.util.Spliterators;
import java.util.function.Consumer;

public class TestRecordUtils {
Copy link
Member

Choose a reason for hiding this comment

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

Could you please consider merging all helpers to LogCompactionTester?

*/
package org.apache.kafka.tools;

public class TestRecord {
Copy link
Member

Choose a reason for hiding this comment

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

Please use record type to streamline it and then inline it to LogCompactionTester

import joptsimple.OptionParser;
import joptsimple.OptionSpec;

public class LogCompactionTesterOptions {
Copy link
Member

Choose a reason for hiding this comment

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

ditto. Move it to LogCompactionTesterOptions and then rename it to Options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Gradle build or GitHub Actions ci-approved core Kafka Broker tests Test fixes (including flaky tests) tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants