Hello, I opened a PR to add slightly more detailed documentation to seek(), as I had spent hours googling when I wanted to use it. After some great reviews from @showuon, I added some integration tests, and I noticed very odd behaviour:
https://github.com/apache/kafka/pull/12753/files#r1007760016 In these tests, we start with 10 messages going to a topic partition, and getting consumed. Then, we seek to an invalid offset. Based on https://medium.com/lydtech-consulting/kafka-consumer-auto-offset-reset-d3962bad2665 The offset reset should kick in, and as new records show up, they should be read. What I have observed (the tests seem to pass locally is): After the above, if I poll, I get an empty list, which makes sense (we're at the end, waiting for new messages) If I seek to offset 17, and then add 10 more messages, the next message I get is offset 17, which is not what the link says, but sort of makes sense, because it's what I asked for. If, however, I seek to 27, and add 10 messages, the next offset I get is 0, which seeks plain wrong. We're neither at the old end (offset 10), or at the new end (offset 20), or where we asked to be (offset 27). Am I doing something wrong/missing something, or is there a bug, and if so, what should I do (file a jira, add a fix to the pr, open a new pr?). What is the desired behaviour? Is it to get message at offset 11 in both cases? Thanks, Dan