Savonitar opened a new pull request, #359:
URL: https://github.com/apache/flink-connector-kafka/pull/359

   ## What is the purpose of the change
   
   Backport [#352](https://github.com/apache/flink-connector-kafka/pull/352) to 
`v4.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 uses v4.0’s `KafkaTestEnvironmentImpl.createNewTopic` 
helper. `TransactionIdFactoryTest` uses JUnit Jupiter and retains test logging 
through `TestLoggerExtension`.
   
   ## Verifying this change
   
   Ran `./mvnw -Dflink.forkCountUnitTest=1 -Dflink.forkCountITCase=1 clean 
verify` on JDK 17 with Flink 2.0.0. All eight modules passed, including all 58 
tests in the three affected classes.
   
   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]

Reply via email to