You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Jason Gustafson (Jira)" <ji...@apache.org> on 2021/04/21 23:00:00 UTC

[jira] [Commented] (KAFKA-9772) Transactional offset commit fails with IllegalStateException

    [ https://issues.apache.org/jira/browse/KAFKA-9772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17326994#comment-17326994 ] 

Jason Gustafson commented on KAFKA-9772:
----------------------------------------

I noticed this recently in our logs. I believe the error is spurious. There are a couple normal situations in which this error can be reported. First is if the TxnOffsetCommit never took place. The process for adding partitions is always to call AddPartitionsToTxn first and then write to the partition. It is possible for the producer to fail after adding the partition but before writing any data. The second case is if the coordinator fails to receive the WriteTxnMarker response. If the broker had already successfully processed the initial request, then we would get a spurious error. I will submit a patch to change this to an info log message.

> Transactional offset commit fails with IllegalStateException
> ------------------------------------------------------------
>
>                 Key: KAFKA-9772
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9772
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Dhruvil Shah
>            Priority: Major
>
> {code:java}
> Trying to complete a transactional offset commit for producerId 7090 and groupId application-id even though the offset commit record itself hasn't been appended to the log.{code}
> {code:java}
> java.lang.IllegalStateException: Trying to complete a transactional offset commit for producerId 7090 and groupId application-id even though the offset commit record itself hasn't been appended to the log. at kafka.coordinator.group.GroupMetadata.$anonfun$completePendingTxnOffsetCommit$2(GroupMetadata.scala:677) at scala.collection.mutable.HashMap.$anonfun$foreach$1(HashMap.scala:149) at scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:237) at scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:230) at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:44) at scala.collection.mutable.HashMap.foreach(HashMap.scala:149) at kafka.coordinator.group.GroupMetadata.$anonfun$completePendingTxnOffsetCommit$1(GroupMetadata.scala:674) at kafka.coordinator.group.GroupMetadata.completePendingTxnOffsetCommit(GroupMetadata.scala:673) at kafka.coordinator.group.GroupMetadataManager.$anonfun$handleTxnCompletion$2(GroupMetadataManager.scala:874) at kafka.coordinator.group.GroupMetadata.inLock(GroupMetadata.scala:228) at kafka.coordinator.group.GroupMetadataManager.$anonfun$handleTxnCompletion$1(GroupMetadataManager.scala:873) at scala.collection.mutable.HashSet.foreach(HashSet.scala:79) at kafka.coordinator.group.GroupMetadataManager.handleTxnCompletion(GroupMetadataManager.scala:870) at kafka.coordinator.group.GroupMetadataManager.$anonfun$scheduleHandleTxnCompletion$1(GroupMetadataManager.scala:865) at kafka.utils.KafkaScheduler.$anonfun$schedule$2(KafkaScheduler.scala:114) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)