jolshan commented on code in PR #23204:
URL: https://github.com/apache/kafka/pull/23204#discussion_r3882847986


##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -738,10 +739,17 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
     +----------------+-------+---------+-------+---------+
     | Empty          | PF    | EB      | PF    | ITS     |
     +----------------+-------+---------+-------+---------+
-    | CompleteAbort  | NONE  | EB      | ITS   | ITS     |
+    | CompleteAbort  | NONE  | EB      | IPE   | ITS     |
     +----------------+-------+---------+-------+---------+
     | CompleteCommit | ITS   | EB      | NONE  | ITS     |
     +----------------+-------+---------+-------+---------+
+
+    CompleteAbort + Commit + Retry returns IPE rather than ITS because the 
coordinator may abort an open
+    transaction on its own (e.g. when it exceeds transaction.timeout.ms), 
bumping the epoch without the
+    producer's knowledge. A commit that was already in flight when such an 
abort completed arrives with the
+    pre-abort epoch and is indistinguishable from a retry. The commit is 
guaranteed not to have taken effect,
+    so the recoverable INVALID_PRODUCER_EPOCH is returned, matching the 
transaction V1 behavior for this race,

Review Comment:
   Just wanted to confirm the reasoning of IPE vs PF here -- it's because in 
TV1 we return IPE? 
   Is the error returned from a different part of the code (ie, in the log code 
right before the write happens)? I didn't see IPE used in this file for TV1



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