Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix consumer in STOPPED state false positive
Consider the folllowing line of kafka events: P: Produce P: Produce C: Commit offset=1 B: Accept Commit offset=1 C: Commit offset=2 B: Dropped Commit offset=2 (due to mindistance) ... B: Consumer is STOPPED In this state, after a while, the consumer is considered stopped, which is clearly not the case: All messages are consumed successfully. Burrow marks the consumer for that topic:partition as stopped because of Rule4. Burrow, in order to prevent partitions with no new messages to be considered stopped, checks if the Lag of the last window is larger/or-equal than the partition's broker offset and if that's the case, inserts an Artificial Offset with Lag=0 and the current Timestamp. It's that Timestamp that prevents marking the consumer stoppped under Rule4. In the above case the artificial offset is not inserted because the Lag of the last window is less than actual Partition's offset. That important last commit was dropped due to mindistance! This is a dirty patch that attempts to deal with that case. In each ConsumerOffset in the ring we piggyback a MaxOffset value that tracks the max offset seen during that period, effectively treating ConsumerOffset as a ConsumerWindow. With that in place, we add an extra step during Artificial Offset code: If MaxOffset is >= than the partition's broker Offset we should insert an Artificial Offset.
- Loading branch information