Skip to content

KAFKA-9203: Check for buggy LZ4 libraries and remove corresponding workarounds#10196

Merged
ijuma merged 3 commits into
apache:trunkfrom
xvrl:detect-broken-lz4
Jul 23, 2021
Merged

KAFKA-9203: Check for buggy LZ4 libraries and remove corresponding workarounds#10196
ijuma merged 3 commits into
apache:trunkfrom
xvrl:detect-broken-lz4

Conversation

@xvrl

@xvrl xvrl commented Feb 23, 2021

Copy link
Copy Markdown
Member

This check allows us to safely remove the workarounds for buggy
LZ4 versions without users encountering cryptic errors if they
accidentally have an older LZ4 library on the classpath, as
described in KAFKA-9203.

With this change the use will get a clear error message indicating
what the problem might be if they encounter this situation.

Note: This now instantiates a compressor in the decompression code.
This should be safe with respect to JNI libraries, since we always use
LZ4Factory.fastestInstance() which takes care of falling back to a pure
Java implementation if JNI libraries are not present.

This was tested with lz4 1.3.0 to make sure it triggers the exception when running KafkaLZ4Test

@omkreddy omkreddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@xvrl Thanks for the PR. Changes looks good to me. But It wasn't clear to me from comment if the reported error is due to older lz4 versions.

@ijuma Does this look good to you?

@xvrl xvrl force-pushed the detect-broken-lz4 branch from 708d075 to b790471 Compare June 14, 2021 17:07
ijuma and others added 3 commits July 22, 2021 13:23
…ache#6679)

lz4/lz4-java#65 was included in lz4-java 1.4.0.

Relying on existing tests for verification.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
This check allows us to safely remove the workarounds for buggy
LZ4 versions without users encountering cryptic errors if they
accidentally have an older LZ4 library on the classpath as
described in KAFKA-9203.

With this change the use will get a clear error message indicating
what the problem might be if they encounter this situation.
@xvrl xvrl force-pushed the detect-broken-lz4 branch from b790471 to 898e3e8 Compare July 22, 2021 20:44

@ijuma ijuma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, failures are unrelated.

@ijuma ijuma merged commit 3ba688e into apache:trunk Jul 23, 2021
xdgrulez pushed a commit to xdgrulez/kafka that referenced this pull request Dec 22, 2021
…rkarounds (apache#10196)

* Remove the workarounds that were added back in apache#7769
* Add a check to detect buggy LZ4 library versions

This check allows us to safely remove the workarounds for buggy
LZ4 versions without users encountering cryptic errors if they
accidentally have an older LZ4 library on the classpath, as
described in KAFKA-9203.

With this change the use will get a clear error message indicating
what the problem might be if they encounter this situation.

Note: This now instantiates a compressor in the decompression code.
This should be safe with respect to JNI libraries, since we always use
`LZ4Factory.fastestInstance()` which takes care of falling back to a pure
Java implementation if JNI libraries are not present.

This was tested with lz4 1.3.0 to make sure it triggers the exception when running
`KafkaLZ4Test`.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Co-authored-by: Ismael Juma <ismael@juma.me.uk>
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.

3 participants