hachikuji commented on code in PR #14489: URL: https://github.com/apache/kafka/pull/14489#discussion_r1406789222
########## core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala: ########## @@ -514,8 +520,14 @@ class TransactionStateManager(brokerId: Int, * When this broker becomes a leader for a transaction log partition, load this partition and populate the transaction * metadata cache with the transactional ids. This operation must be resilient to any partial state left off from * the previous loading / unloading operation. + * + * If the state is already loaded (leader epoch bumps, but we have the same leader), just update the epoch in the + * metadata cache and for all the pending markers. */ - def loadTransactionsForTxnTopicPartition(partitionId: Int, coordinatorEpoch: Int, sendTxnMarkers: SendTxnMarkersCallback): Unit = { + def maybeLoadTransactionsAndBumpEpochForTxnTopicPartition(partitionId: Int, Review Comment: Yeah, the original name seems fine to me. We are still loading the transactions. We just have an optimization when we already had state from a previous epoch. -- 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