Skip to content
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

gzip and snappy compression not working when min Produce RPC version is set to 3 on broker side #4956

Open
pranavrth opened this issue Jan 29, 2025 · 1 comment

Comments

@pranavrth
Copy link
Member

With the KIP-896 support in AK, gzip and snappy compression not working when min Produce RPC version is set to 3.

Test in 0077.c fails when the broker supports v3 as min version. The produce request falls back to producing without compression in librdkafka.

Logs shows something like this:

%5|1737669142.910|COMPRESSION|0077_compaction#producer-342| [thrd:localhost:58967/bootstrap]: localhost:58967/3: rdkafkatest_rnd15be1a9b23929650_0077-compaction.c [0]: Broker does not support compression type gzip: not compressing batch

%5|1737669116.239|COMPRESSION|0077_compaction#producer-322| [thrd:localhost:40627/bootstrap]: localhost:40627/2: rdkafkatest_rnd49c8fc9d6fbd0db3_0077-compaction.c [0]: Broker does not support compression type snappy: not compressing batch
@ijuma
Copy link
Member

ijuma commented Jan 29, 2025

As discussed offline, this also affects lz4. And zstd also has the same type of logic bug - it checks for a specific version instead of checking that the supported version is greater or equal than the minimum version required. We should fix all 4 at the same time.

ijuma added a commit to apache/kafka that referenced this issue Feb 2, 2025
…returns produce v0 (#18727)

Return produce v0-v2 as supported versions in `ApiVersionsResponse`, but disable support
for it everywhere else.

Since clients pick the highest supported version by both client and broker during version
negotiation, this solves the problem with minimal tech debt (even though it's not ideal that
`ApiVersionsResponse` becomes inconsistent with the actual protocol support).

Add one test for the socket server handling (in `ProcessorTest`) and one test for the
client behavior (in `ProduceRequestTest`). Adjust a couple of api versions tests to verify
the new behavior.

Finally, include a few clean-ups in `ApiKeys`, `Protocol`, `ProduceRequest`,
`ProduceRequestTest` and `BrokerApiVersionsCommandTest`.

Reference to related librdkafka issue:
confluentinc/librdkafka#4956

Reviewers: Jun Rao <[email protected]>, Chia-Ping Tsai <[email protected]>, Stanislav Kozlovski <[email protected]>
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

No branches or pull requests

2 participants