forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-8132][kafka] Re-initialize transactional KafkaProducer on each…
… checkpoint Previously faulty scenario with producer pool of 2. 1. started transaction 1 with producerA, written record 42 2. checkpoint 1 triggered, pre committing txn1, started txn2 with producerB, written record 43 3. checkpoint 1 completed, committing txn1, returning producerA to the pool 4. checkpoint 2 triggered , committing txn2, started txn3 with producerA, written record 44 5. crash.... 6. recover to checkpoint 1, txn1 from producerA found to "pendingCommitTransactions", attempting to recoverAndCommit(txn1) 7. unfortunately txn1 and txn3 from the same producers are identical from KafkaBroker perspective and thus txn3 is being committed result is that both records 42 and 44 are committed. With this fix, after re-initialization txn3 will have different producerId/epoch counters compared to txn1.
- Loading branch information
Showing
2 changed files
with
91 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters