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


##########
core/src/main/scala/kafka/coordinator/transaction/TransactionMetadata.scala:
##########
@@ -346,14 +346,14 @@ private[transaction] class TransactionMetadata(val 
transactionalId: String,
 
     // Since the state change was successfully written to the log, unset the 
flag for a failed epoch fence
     hasFailedEpochFence = false
-    val (updatedProducerId, updatedProducerEpoch) =
+    val (updatedProducerId, updatedProducerEpoch, updatedLastProducerEpoch) =
       // If we overflowed on epoch bump, we have to set it as the producer ID 
now the marker has been written.
       if (clientTransactionVersion.supportsEpochBump() && nextProducerId != 
RecordBatch.NO_PRODUCER_ID) {
-        (nextProducerId, 0.toShort)
+        (nextProducerId, 0.toShort, producerEpoch)

Review Comment:
   I thought this was correct since this will be the correct transition from 
the coordinator point of view.
   Otherwise we will have max epoch - 1 as the last epoch. This was originally 
changed due to how we check for valid epochs.
   
   I would have to double check, but I think this was also how the retry is 
checked



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to