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


##########
transaction-coordinator/src/main/java/org/apache/kafka/coordinator/transaction/TransactionMetadata.java:
##########
@@ -276,29 +350,42 @@ public TxnTransitMetadata prepareComplete(long 
updateTimestamp) {
         // but lastProducerEpoch remains MAX-1 to maintain consistency with 
what the client last saw.
         if (clientTransactionVersion.supportsEpochBump() && nextProducerId != 
RecordBatch.NO_PRODUCER_ID) {
             data.producerId = nextProducerId;
-            data.producerEpoch = 0;
+            data.producerEpoch = hasNextProducerEpoch() ? nextProducerEpoch : 
0;

Review Comment:
   should we also update the comment to mention we may not always reset the 
epoch to 0. (And lastProducerEpoch is not always MAX - 1)



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