Closed arjunnair1997 closed 3 months ago
I think the scenario you describe is theoretically possible, even though technically it's extremely unlikely (borderline impossible).
There's nothing in an OffsetCommit request that strictly can enforce advancing commits. Theoretically, Kafka could receive a request, and then the thread processing that request could hang for an hour while the client times out, commits on a different thread successfully, consumes, and commits again. The original thread could eventually unhang and rewind things.
However realistically, I've never even considered this as a worry because it's so implausible.
I think the only way this could be prevented is if OffsetCommit had an epoch field that was required to strictly advance; it does not.
Not sure if this really helps your scenario but it does answer your question. Sorry for the delay. Anything I could do to help here?
Let me know if there's more here, closing for now.
The setup:
The consumer workload has the consumer polling 1 record at a time, committing the offset associated with the record, and then making modifications to some in memory state in accordance with the polled record. I want a record to be consumed at most once, and I don't want the committed offset to revert.
However, the situation I'm worried about is as follows:
Is this behaviour prevented by franz-go or even the overall kafka protocol? cc @twmb