jolshan commented on code in PR #23943:
URL: https://github.com/apache/kafka/pull/23943#discussion_r4393659779
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala:
##########
@@ -245,8 +246,12 @@ class TransactionStateManager(brokerId: Int,
private[transaction] def removeExpiredTransactionalIds(): Unit = {
inReadLock[Exception](stateLock, () => {
transactionMetadataCache.foreachEntry { (partitionId,
partitionCacheEntry) =>
- val transactionPartition = new
TopicPartition(Topic.TRANSACTION_STATE_TOPIC_NAME, partitionId)
- removeExpiredTransactionalIds(transactionPartition,
partitionCacheEntry)
+ // the cache entry of a partition that is being reloaded (e.g. after a
leader epoch bump) is about to be
+ // replaced, and the load relies on the log end offset not changing
while it waits for the high watermark
+ if (!loadingPartitions.exists(_.txnPartitionId == partitionId)) {
Review Comment:
Looks like all other appended records are gated by
`getAndMaybeAddTransactionState`. Interesting this one isn't. And good catch :)
--
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]