jolshan commented on code in PR #17698: URL: https://github.com/apache/kafka/pull/17698#discussion_r1866762808
########## core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala: ########## @@ -564,41 +627,44 @@ class TransactionCoordinator(txnConfig: TransactionConfig, else PrepareAbort - // Maybe allocate new producer ID if we are bumping epoch and epoch is exhausted - val nextProducerIdOrErrors = - if (clientTransactionVersion.supportsEpochBump() && !txnMetadata.pendingState.contains(PrepareEpochFence) && txnMetadata.isProducerEpochExhausted) { - try { - Right(producerIdManager.generateProducerId()) - } catch { - case e: Exception => Left(Errors.forException(e)) - } + generateTxnTransitMetadataForTxnCompletion(nextState, false) + case CompleteCommit => + if (currentTxnMetadataIsAtLeastTransactionsV2) { + if (txnMarkerResult == TransactionResult.COMMIT) { + if (isRetry) Review Comment: I'm wondering if it could be useful to specify commit vs abort instead of just if commit. It gets a little confusing to understand the if cases here between v1,v2, retries, and commit/abort -- 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