jolshan commented on code in PR #17698: URL: https://github.com/apache/kafka/pull/17698#discussion_r1854625036
########## core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala: ########## @@ -498,6 +498,39 @@ class TransactionCoordinator(txnConfig: TransactionConfig, requestLocal) } + /* + Here is the table to demonstrate the state transition for Empty, CompleteAbort, CompleteCommit in Transaction V2. + Note: + PF = PRODUCER_FENCED + ITS = INVALID_TXN_STATE + NONE = No error and no epoch bump + EB = No error and epoch bump + + Retry => producerEpoch = txnState.ProducerEpoch - 1 + Current => producerEpoch = txnState.ProducerEpoch + + ------------------------------------------------------ + With transaction V1, Retry is not allowed, PRODUCER_FENCED will be returned if the epoch does not match. + Empty does not accept Abort and Commit. + CompleteAbort only accepts Abort. + CompleteCommit only accepts Commit. + For all invalid cases, INVALID_TXN_STATE is returned. + + ------------------------------------------------------ + With transaction V2. + +----------------+-----------------+-----------------+ + | | Abort | Commit | + +----------------+-------+---------+-------+---------+ + | | Retry | Current | Retry | Current | + +----------------+-------+---------+-------+---------+ + | Empty | PF | EB | ITS | ITS | + +----------------+-------+---------+-------+---------+ + | CompleteAbort | NONE | EB | ITS | ITS | + +----------------+-------+---------+-------+---------+ + | CompleteCommit | ITS | EB | NONE | ITS | Review Comment: complete commit + current + commit should be eb right? -- 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