rreddy-22 commented on code in PR #17402:
URL: https://github.com/apache/kafka/pull/17402#discussion_r1823190412
##########
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:
Artem's Message Offline
> I think it would be more consistent to preserver lastProducerEpoch in the
prepareComplete transition: the client will see the sequence, max-1, then 0,
but the epoch will transition as max-1, max, 0 (the max value is not visible to
the client but it'll be there as part of transition), so mathematically if
lastEpoch is what the client saw last, then it should be 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]