zhaohaidao commented on a change in pull request #9311: URL: https://github.com/apache/kafka/pull/9311#discussion_r502740233
########## File path: clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java ########## @@ -369,7 +372,9 @@ private TransactionalRequestResult beginCompletingTransaction(TransactionResult // If the error is an INVALID_PRODUCER_ID_MAPPING error, the server will not accept an EndTxnRequest, so skip // directly to InitProducerId. Otherwise, we must first abort the transaction, because the producer will be // fenced if we directly call InitProducerId. - if (!(lastError instanceof InvalidPidMappingException)) { + boolean needEndTxn = !(abortableError instanceof InvalidPidMappingException) Review comment: I am not sure this helper is worthwhile because it is only used in beginCompletingTransaction. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org