[
https://issues.apache.org/jira/browse/FLINK-41598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martijn Visser resolved FLINK-41598.
------------------------------------
Fix Version/s: kafka-4.0.2
kafka-5.0.1
kafka-5.1.1
kafka-5.2.0
Resolution: Fixed
Fixed in apache/flink-connector-kafka:
main: e764aba9edd8723df6576b00935c00932fa4d59c
v5.1: 9474a6d80f77d44f4eaeb5ac73f57e160cb09250
v5.0: ccbb449bb0f24887e29f9abe4ce54d450f327505
v4.0: a36b1f87317db2edf3acf5a6b4aedb9b4cef812b
> Overlapping transactional ID prefixes can cause data loss in KafkaSink
> POOLING mode
> -----------------------------------------------------------------------------------
>
> Key: FLINK-41598
> URL: https://issues.apache.org/jira/browse/FLINK-41598
> Project: Flink
> Issue Type: Bug
> Components: Connectors / Kafka
> Reporter: Aleksandr Savonin
> Assignee: Aleksandr Savonin
> Priority: Critical
> Labels: pull-request-available
> Fix For: kafka-4.0.2, kafka-5.0.1, kafka-5.1.1, kafka-5.2.0
>
>
> With exactly-once delivery and TransactionNamingStrategy.POOLING, a KafkaSink
> writer lists ongoing Kafka transactions on startup to clean up transactions
> left by a previous attempt. It uses a startsWith check to identify its
> transactions, so distinct transactional ID prefixes can match the same ID.
> To reproduce, start a sink with the prefix "sink-2" and let it write a record
> in an open transaction such as "sink-2-0-0". Before that transaction commits,
> start a second sink with the prefix "sink" on the same topic. The second sink
> can abort "sink-2-0-0" and fence the first producer. If the transaction was
> awaiting checkpoint commit, its records can be lost from the committed Kafka
> output.
> The same prefix check can also prevent startup. For example, if another
> producer has an open transaction named "sink-a-b", the writer tries to parse
> "a" as a subtask ID and throws NumberFormatException.
> Cleanup should only consider IDs that match the connector’s generated format
> for a configured or restored prefix: <prefix><subtaskId{-}>{-}<offset>. A
> writer with prefix "sink" should ignore both "sink-2-0-0" and "sink-a-b" and
> leave those producers able to commit.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)