jeffkbkim commented on code in PR #18011:
URL: https://github.com/apache/kafka/pull/18011#discussion_r1868437577
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala:
##########
@@ -596,10 +596,9 @@ class TransactionStateManager(brokerId: Int,
*/
def removeTransactionsForTxnTopicPartition(partitionId: Int,
coordinatorEpoch: Int): Unit = {
val topicPartition = new
TopicPartition(Topic.TRANSACTION_STATE_TOPIC_NAME, partitionId)
- val partitionAndLeaderEpoch =
TransactionPartitionAndLeaderEpoch(partitionId, coordinatorEpoch)
inWriteLock(stateLock) {
- loadingPartitions.remove(partitionAndLeaderEpoch)
Review Comment:
to confirm, this line was a noop in practice since there would never be a
case where the partitionAndLeaderEpoch from L599 exists.
with an example:
1. become leader for partition 0 -> load partition 0, epoch 1 to
loadingPartitions
2. during load, becomes follower for partition 0 epoch 2
3. without fix: does not remove partition 0 from loading partitions / with
fix: removes partition 0 from loadingPartitions
Is my understanding correct?
What's the impact without the fix?
--
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]