Shekharrajak commented on code in PR #22704:
URL: https://github.com/apache/kafka/pull/22704#discussion_r3493784606
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -171,6 +170,23 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
case Some(epochAndTxnMetadata) => Right(epochAndTxnMetadata)
}
+ // 2PC recovery: if the client wants to keep a prepared transaction and
an ongoing 2PC
+ // transaction exists, preserve it and return its producer id/epoch so
the client can
+ // finalize it. There is no state change, so respond directly without a
log append.
+ val preservedResult = coordinatorEpochAndMetadata.toOption.flatMap {
existingEpochAndMetadata =>
+ val txnMetadata = existingEpochAndMetadata.transactionMetadata
Review Comment:
The epoch fence is skipped on the preserve path —
the prepared txn's epoch must stay valid for completeTransaction.
--
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]