Skip to content

KAFKA-21152: LogCompactionTester should read until the end offsets instead of stopping at an empty poll - #23572

Draft
unknowntpo wants to merge 1 commit into
apache:trunkfrom
unknowntpo:log-compaction-tester-empty-poll
Draft

unknowntpo wants to merge 1 commit into
apache:trunkfrom
unknowntpo:log-compaction-tester-empty-poll

Conversation

@unknowntpo

@unknowntpo unknowntpo commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

LogCompactionTest.test_log_compaction is flaky because
LogCompactionTester stops at the first empty poll(). Since
KAFKA-12980, poll() can return no records while data remains (after
compaction, the position jumps past removed records, see KAFKA-14865),
so the tester sometimes stops early and the validation fails.

This change gets the end offsets before consuming and polls until the
position of every partition reaches its end offset. It gives up only
when a poll returns no records and moves no position.
LogCompactionTesterTest covers an empty poll before the end offset
with MockConsumer.

@github-actions github-actions Bot added triage PRs from the community tools labels Sep 24, 2026
…stead of stopping at an empty poll

Since KAFKA-12980, poll() can return no records while the position
advances, for example past records removed by compaction. So an empty
poll does not mean the end of the log. Read until the position of every
partition reaches the end offset, and only give up when a poll returns
nothing and moves no position.

Generated-by: Claude Opus 5.5
@unknowntpo
unknowntpo force-pushed the log-compaction-tester-empty-poll branch from 604cbfb to 9d0a6fe Compare September 24, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant