[ https://issues.apache.org/jira/browse/KAFKA-3179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125612#comment-15125612 ]
ASF GitHub Bot commented on KAFKA-3179: --------------------------------------- GitHub user becketqin opened a pull request: https://github.com/apache/kafka/pull/842 KAFKA-3179 Fix seek on compressed messages The fix itself is simple. Some explanation on unit tests. Currently we the vast majority of unit test is running with uncompressed messages. I was initially thinking about run all the tests using compressed messages. But it seems uncompressed messages are necessary in a many test cases because we need the bytes sent and appended to the log to be predictable. In most of other cases, it does not matter whether the message is compressed or not, and compression will slow down the unit test. So I just added one method in the BaseConsumerTest to send compressed messages whenever we need it. You can merge this pull request into a Git repository by running: $ git pull https://github.com/becketqin/kafka KAFKA-3179 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/842.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #842 ---- commit 0f5cd3184f63ba9ec93c4450f81e0222ae96b422 Author: Jiangjie Qin <becket....@gmail.com> Date: 2016-02-01T01:38:37Z KAFKA-3179 Fix seek on compressed messages ---- > Kafka consumer delivers message whose offset is earlier than sought offset. > --------------------------------------------------------------------------- > > Key: KAFKA-3179 > URL: https://issues.apache.org/jira/browse/KAFKA-3179 > Project: Kafka > Issue Type: Bug > Components: clients > Affects Versions: 0.9.0.0 > Reporter: Jiangjie Qin > Assignee: Jiangjie Qin > Fix For: 0.9.0.1 > > > This problem is reproducible by seeking to the middle a compressed message > set. Because KafkaConsumer does not filter out the messages earlier than the > sought offset in the compressed message. The message returned to user will > always be the first message in the compressed message set instead of the > message user sought to. -- This message was sent by Atlassian JIRA (v6.3.4#6332)