Skip to content

KAFKA-19221: Backport to 4.0 #20072

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

Merged
merged 1 commit into from
Jul 5, 2025

Conversation

gaurav-narula
Copy link
Contributor

This backports KAFKA-19221 to 4.0 branch. The patch applied cleanly but there was a build failure in the test due to recent refactoring.

broker.shutdown();

assertEquals(1, broker.config().logDirs().size());
String logDir = broker.config().logDirs().head();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This cherry-pick uses logDirs().head() instead of logDirs().get(0)

@gaurav-narula
Copy link
Contributor Author

@chia7712 The test failure in Java 23 is due to flakyness in TransactionsTest#testBumpTransactionalEpochWithTV2Disabled that's unrelated to this cherry-pick. I've raised #20102 to backport the flakyness fix as well to 4.0

@chia7712
Copy link
Member

chia7712 commented Jul 4, 2025

@gaurav-narula I will merge #20102 first

@chia7712
Copy link
Member

chia7712 commented Jul 4, 2025

@gaurav-narula could you please sync 4.0 to trigger QA again?

Log segment closure results in right sizing the segment on disk along
with the associated index files.

This is specially important for TimeIndexes where a failure to right
size may eventually cause log roll failures leading to under replication
and log cleaner failures.

This change uses `Utils.closeAll` which propagates exceptions, resulting
in an "unclean" shutdown. That would then cause the broker to attempt to
recover the log segment and the index on next startup, thereby avoiding
the failures described above.

Reviewers: Omnia Ibrahim <[email protected]>, Jun Rao
 <[email protected]>, Chia-Ping Tsai <[email protected]>
@gaurav-narula gaurav-narula force-pushed the KAFKA-19221-4.0-backport branch from eafff7d to aae3bbe Compare July 4, 2025 21:03
@chia7712 chia7712 merged commit 8433ac4 into apache:4.0 Jul 5, 2025
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants