-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Consumer with API version set to V0_10_0_0 fails to consume compressed topics #720
Comments
Is there non-code documentation of these relative offsets? I don't remember seeing anything about this in the release notes or on https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol |
None that I could find. The documentation in regards to compression does not mention this however the Java client implements it (I only checked the Java client). (Seems I did a pretty bad job at finding this considering KIP-31 :-() |
@edenhill does rdkafka handle this properly? Is there documentation on this change anywhere? |
New message format does something weird with these. See https://cwiki.apache.org/confluence/display/KAFKA/KIP-31+-+Move+to+relative+offsets+in+compressed+message+sets Fixes #720. Supercedes #721. Thanks to @dynamix for the first draft of the fix.
Versions
Configuration
--create --topic test --partitions 1 --replication-factor 1
Logs
(removed the "ClientID set to sarama" entries)
Problem Description
Code that reproduces the issue (broker ip should be set to a proper value): https://gist.github.com/dynamix/e7682ff7a76d28bd500ebee52c036b28
A consumer where Config.Version is set to V0_10_0_0 does not properly consume compressed topics. If the Config.Version is set to any lower value - everything works as it should.
Looking at what kafka returns - the offsets of messages inside a compressed message are relative and not absolute for 0.10+. The Java Consumer has a special handling for relative offsets: https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/record/MemoryRecords.java#L242-L318
Attempted fix (not sure if this handles all cases): #721
The text was updated successfully, but these errors were encountered: