slachiewicz commented on code in PR #314:
URL: 
https://github.com/apache/flink-connector-kafka/pull/314#discussion_r4054032686


##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/internal/ProducerPool.java:
##########
@@ -40,9 +40,23 @@ public interface ProducerPool extends AutoCloseable {
     FlinkKafkaInternalProducer<byte[], byte[]> getTransactionalProducer(
             String transactionalId, long checkpointId);
 
-    /** Returns a snapshot of all ongoing transactions. */
+    /**
+     * Returns a snapshot of all ongoing transactions. Transactions opened by 
this pool carry the
+     * producer id and epoch of their producer; transactions restored from 
state keep whatever the
+     * state recorded.
+     */
     Collection<CheckpointTransaction> getOngoingTransactions();
 
+    /**
+     * Stops tracking a transaction that was restored from state without 
touching a producer. Used
+     * on recovery when the broker no longer holds the restored transaction 
under its transactional
+     * id because the id was reused for a later checkpoint, so that the id can 
be aborted and
+     * reused.

Review Comment:
   Rewritten with the reserved semantics: the id stays tracked as ongoing and 
is not reused until the committer reports the outcome of the restored 
transaction or a later checkpoint's transaction is reported finished.



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