Savonitar opened a new pull request, #358: URL: https://github.com/apache/flink-connector-kafka/pull/358
## What is the purpose of the change Backport [#352](https://github.com/apache/flink-connector-kafka/pull/352) to `v5.0` for [FLINK-41598](https://issues.apache.org/jira/browse/FLINK-41598). When a Kafka sink using `POOLING` starts, it can abort an open transaction that belongs to another sink with an overlapping prefix. For example, a writer with prefix `sink` could fence the producer of `sink-2-0-0` and lose records waiting for checkpoint commit. A malformed ID such as `sink-a-b` could also prevent the writer from starting. ## Brief change log - `TransactionalIdFactory.hasPrefix` matches the configured prefix and the two numeric fields produced by `buildTransactionalId`. - The listing abort strategy checks that format against the current and restored prefixes before checking subtask ownership. The integration test imports the Kafka `Admin` interface explicitly on this branch. ## Verifying this change All 58 tests in the three affected classes passed on JDK 17 with Flink 2.1.0. The first full build stalled on a second execution of `SinkTestSuiteBase.testScaleUp`. A fresh `./mvnw -Dflink.forkCountUnitTest=1 -Dflink.forkCountITCase=1 '-Djunit.jupiter.execution.timeout.default=5 m' clean verify` passed all eight modules, including both executions of that test. Unit tests cover overlapping, changed, and empty prefixes, malformed IDs, and cleanup continuing to an owned transaction. Six Kafka integration cases verify that a foreign producer can commit and that its record is visible to a `read_committed` consumer on shared and separate topics. ## Does this pull request potentially affect one of the following parts? - Dependencies — No. - Public API, Table options, or PyFlink wrappers — No. - Exactly-once delivery — Yes. The fix changes which transactions a writer aborts during recovery. Checkpointed state and serializers are unchanged. - Per-record code paths — No. ## Documentation - New feature? No. This fixes existing recovery behavior. - Feature documentation and updates to the English and Chinese docs — Not applicable. --- ##### Was generative AI tooling used to co-author this PR? - [x] Yes Generated-by: Claude Code (Claude Fable 5.2), OpenAI Codex CLI 0.171.0-alpha.13 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
