Skip to content

KAFKA-20361 : Fix LazyDownConversionRecordsTest in using zlib-ng#21881

Open
muralibasani wants to merge 1 commit intoapache:3.9from
muralibasani:KAFKA-20361-fix-lazy-downconversion-zlib-ng
Open

KAFKA-20361 : Fix LazyDownConversionRecordsTest in using zlib-ng#21881
muralibasani wants to merge 1 commit intoapache:3.9from
muralibasani:KAFKA-20361-fix-lazy-downconversion-zlib-ng

Conversation

@muralibasani
Copy link
Copy Markdown
Contributor

The test's write loop passed bytesToConvert - written as the remaining parameter to LazyDownConversionRecordsSend.writeTo(). This shrinks with each batch written, and the last batch gets truncated via Math.min(batchSize, remaining) when total V1 size exceeds V2 size — which happens with zlib-ng due to its longer match sizes compressing V1 format less efficiently.

Fix: pass bytesToConvert (constant) as remaining so no individual batch is ever truncated, regardless of the compression library used.

@muralibasani muralibasani changed the title Fix LazyDownConversionRecordsTest in using zlib-ng KAFKA-20361 : Fix LazyDownConversionRecordsTest in using zlib-ng Mar 26, 2026
@muralibasani
Copy link
Copy Markdown
Contributor Author

@chia7712 tried with this fix on the class to avoid those individual batch truncation.

@muralibasani muralibasani force-pushed the KAFKA-20361-fix-lazy-downconversion-zlib-ng branch from abd5cf1 to 30bb463 Compare March 29, 2026 06:38
@muralibasani
Copy link
Copy Markdown
Contributor Author

@chia7712 I see build fails with spotless error, for unrelated change. Tried fixing in this pr.

Execution failed for task ':core:spotlessJavaCheck'.
--
  |   |   | > The following files had format violations:
  |   |   | src/test/java/kafka/server/SocketServerMemoryPoolTest.java

@chia7712
Copy link
Copy Markdown
Member

@muralibasani would you mind opening a separate PR to fix it?

@chia7712
Copy link
Copy Markdown
Member

@muralibasani mind rebasing to pull in #21893 ?

@muralibasani muralibasani force-pushed the KAFKA-20361-fix-lazy-downconversion-zlib-ng branch from 30bb463 to 869d503 Compare March 30, 2026 10:10
@muralibasani
Copy link
Copy Markdown
Contributor Author

@muralibasani mind rebasing to pull in #21893 ?

@chia7712 it's rebased now.

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.

2 participants