AHeise commented on code in PR #154:
URL: 
https://github.com/apache/flink-connector-kafka/pull/154#discussion_r1969172042


##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/ExactlyOnceKafkaWriter.java:
##########
@@ -136,13 +158,10 @@ public void initialize() {
     }
 
     private FlinkKafkaInternalProducer<byte[], byte[]> startTransaction(long 
checkpointId) {
+        namingContext.setNextCheckpointId(checkpointId);
         FlinkKafkaInternalProducer<byte[], byte[]> producer =
-                producerPool.getTransactionalProducer(
-                        TransactionalIdFactory.buildTransactionalId(
-                                transactionalIdPrefix,
-                                kafkaSinkContext.getParallelInstanceId(),
-                                checkpointId),
-                        checkpointId);
+                
transactionNamingStrategy.getTransactionalProducer(namingContext);
+        namingContext.setLastCheckpointId(checkpointId);

Review Comment:
   Not sure how to improve it. There could be an arbitrary number of aborted 
transactions between the two invocations of the call-site. For me, these are 
two disjunct states that are coupled in the best case but not in the general 
case. Remember that we need to `setLastCheckpointId` once already during 
recovery.



-- 
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