guozhangwang commented on a change in pull request #11098:
URL: https://github.com/apache/kafka/pull/11098#discussion_r677649333



##########
File path: 
core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala
##########
@@ -161,22 +162,26 @@ class TransactionStateManager(brokerId: Int,
             maxBatchSize
           )
 
-          partitionCacheEntry.metadataPerTransactionalId.foreachWhile { 
(transactionalId, txnMetadata) =>
+          var breakIteration = false

Review comment:
       I think I may miss something here, could you explain why we'd need both 
the caller/callee doing this while loop with the break iteration flag? It seems 
to me that we have multiple reasons to break early: 1) we've reached the record 
limit, 2) the partition is already offline, and we want to treat them 
differently and hence the both while loops, right?
   
   But I cannot see exactly where we may have case 2)?




-- 
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


Reply via email to