zhaohaidao commented on a change in pull request #9311: URL: https://github.com/apache/kafka/pull/9311#discussion_r505708598
########## File path: clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java ########## @@ -1198,18 +1209,22 @@ boolean canBumpEpoch() { return coordinatorSupportsBumpingEpoch; } + private void resetTransactions() { + newPartitionsInTransaction.clear(); + pendingPartitionsInTransaction.clear(); + partitionsInTransaction.clear(); + } + private void completeTransaction() { if (epochBumpRequired) { transitionTo(State.INITIALIZING); } else { transitionTo(State.READY); } lastError = null; + abortableError = null; epochBumpRequired = false; - transactionStarted = false; Review comment: If this is the case, could we just remove this intermediate variable? ================================ It could have been omitted, but now this variable has a new use when call initTransactions. ---------------------------------------------------------------- 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