[ 
https://issues.apache.org/jira/browse/KAFKA-14294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17630328#comment-17630328
 ] 

Bruno Cadonna commented on KAFKA-14294:
---------------------------------------

Streams does not commit a transaction if no records have been consumed from the 
input topic. See 
https://github.com/apache/kafka/blob/cd4a1cb4101abcc7cdd1d2d0d73662114108f3e5/streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskExecutor.java#L182
It does not matter whether {{commitNeeded}} is set to true or not.

If a punctuator writes to a state store but not records are consumed from the 
input topic, a transaction is started but it is never committed. 
  

> Kafka Streams should commit transaction when no records are processed
> ---------------------------------------------------------------------
>
>                 Key: KAFKA-14294
>                 URL: https://issues.apache.org/jira/browse/KAFKA-14294
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>    Affects Versions: 3.2.1
>            Reporter: Vicky Papavasileiou
>            Priority: Major
>
> Currently, if there are no records to process in the input topic, a 
> transaction does not commit. If a custom punctuator code is writing to a 
> state store (which is common practice) the producer gets fenced when trying 
> to write to the changelog topic. This throws a TaskMigratedException and 
> causes a rebalance. 
> A better approach would be to commit a transaction even when there are no 
> records processed as to allow the punctuator to make progress. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to