NicoK opened a new pull request #9323: [FLINK-13535][kafka] do not abort 
transactions twice during KafkaProducer startup
URL: https://github.com/apache/flink/pull/9323
 
 
   ## What is the purpose of the change
   
   During startup of a transactional Kafka producer from previous state, we 
recover in two steps:
   1) in `TwoPhaseCommitSinkFunction`, we commit pending commit-transactions 
and abort pending transactions and then call into `finishRecoveringContext()`
   2) in `FlinkKafkaProducer#finishRecoveringContext()` we iterate over all 
recovered transaction IDs and abort them.
   
   This may lead to some transactions being worked on twice and there is quite 
some overhead from creating a `KafkaProducer` for each of these transactions.
   
   ## Brief change log
   
   - provide `finishRecoveringContext()` with a collection of all transactions 
that `TwoPhaseCommitSinkFunction` already covered
   - adapt `FlinkKafkaProducer` and `FlinkKafkaProducer011` to ignores 
transactional IDs from that set
   
   ## Verifying this change
   
   This change is already covered by existing tests, such as 
`FlinkKafkaProducerITCase` and `KafkaProducerExactlyOnceITCase`.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): **no**
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: **yes**
     - The serializers: **no**
     - The runtime per-record code paths (performance sensitive): **no**
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: **no**
     - The S3 file system connector: **no**
   
   ## Documentation
   
     - Does this pull request introduce a new feature? **no**
     - If yes, how is the feature documented? **JavaDocs**
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to