[
https://issues.apache.org/jira/browse/FLINK-31363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17701390#comment-17701390
]
Tzu-Li (Gordon) Tai commented on FLINK-31363:
---------------------------------------------
[~lightzhao] I'm preparing a fix for this.
I think the correct fix is to *not* add a txn's metadata into the checkpoint if
there were no data written to the transaction.
i.e. the checkpoints will only reflect metadata of txns that actually have data
that need to be committed.
This way, creation of recovery producers can always safely set the
{{transactionStarted}} flag to {{true}}
> KafkaSink failed to commit transactions under EXACTLY_ONCE semantics
> --------------------------------------------------------------------
>
> Key: FLINK-31363
> URL: https://issues.apache.org/jira/browse/FLINK-31363
> Project: Flink
> Issue Type: Bug
> Components: Connectors / Kafka
> Affects Versions: 1.17.0, 1.16.1, 1.18.0
> Reporter: lightzhao
> Priority: Major
> Labels: pull-request-available
> Attachments: image-2023-03-08-10-54-51-410.png
>
>
> When KafkaSink starts Exactly once and no data is written to the topic during
> a checkpoint, the transaction commit exception is triggered, with the
> following exception.
> [Transiting to fatal error state due to
> org.apache.kafka.common.errors.InvalidTxnStateException: The producer
> attempted a transactional operation in an invalid state.]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)