CalvinConfluent commented on code in PR #17698:
URL: https://github.com/apache/kafka/pull/17698#discussion_r1870423392
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -723,9 +980,8 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
// When a client and server support V2, every endTransaction call bumps the
producer epoch. When checking epoch, we want to
// check epoch + 1. Epoch bumps from PrepareEpochFence state are handled
separately, so this method should not be used to check that case.
// Returns true if the transaction state epoch is the specified producer
epoch + 1 and epoch bump on every transaction is expected.
- private def endTxnEpochBumped(txnMetadata: TransactionMetadata,
producerEpoch: Short): Boolean = {
- !txnMetadata.pendingState.contains(PrepareEpochFence) &&
txnMetadata.clientTransactionVersion.supportsEpochBump() &&
- txnMetadata.producerEpoch == producerEpoch + 1
+ private def endTxnEpochBumped(txnMetadata: TransactionMetadata,
producerEpoch: Short, supportsEpochBump: Boolean): Boolean = {
+ !txnMetadata.pendingState.contains(PrepareEpochFence) && supportsEpochBump
&& txnMetadata.producerEpoch == producerEpoch + 1
Review Comment:
Actually in the V2 path, the `supportsEpochBump` is only false for fenced
producer which is the same as the first condition, so we can remove it.
--
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]