Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9765

Could not add partitions to transaction due to errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Duplicate
    • 2.3.1
    • 2.5.0, 2.4.2
    • clients, producer
    • None

    Description

      I am following the producer with transactions example in https://kafka.apache.org/23/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html, and on kafkaException, I use abortTransaction and retry. 

      I am seeing these exceptions. Has anyone experienced this before ? Please suggest

      // code placeholder
      
      java.util.concurrent.ExecutionException: org.apache.kafka.common.KafkaException: Could not add partitions to transaction due to errors: {nfvAlarmJob-0=UNKNOWN_SERVER_ERROR}
              at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.valueOrError(FutureRecordMetadata.java:98)
              at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:67)
              at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:30)
              at com.vmware.vchs.hybridity.messaging.kafka.KafkaProducerDelegate.publishMessageWithTransaction(KafkaProducerDelegate.java:197)
              at com.vmware.vchs.hybridity.messaging.kafka.KafkaProducerDelegate.publish(KafkaProducerDelegate.java:164)
              at com.vmware.vchs.hybridity.messaging.kafka.KafkaProducerDelegate.publish(KafkaProducerDelegate.java:158)
              at com.vmware.vchs.hybridity.messaging.adapter.JobManagerJobPublisher.publish(JobManagerJobPublisher.java:140)
              at com.vmware.vchs.hybridity.messaging.adapter.JobManager.queueJob(JobManager.java:1720)
              at com.vmware.vchs.hybridity.messaging.adapter.JobManagementAdapter.queueJob(JobManagementAdapter.java:80)
              at com.vmware.vchs.hybridity.messaging.adapter.JobManagementAdapter.queueJob(JobManagementAdapter.java:70)
              at com.vmware.vchs.hybridity.messaging.adapter.JobManagedService.queueJob(JobManagedService.java:168)
              at com.vmware.hybridity.nfvm.alarm.UpdateVcenterAlarmsJob.run(UpdateVcenterAlarmsJob.java:67)
              at com.vmware.vchs.hybridity.messaging.LoggingJobWrapper.run(LoggingJobWrapper.java:41)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: org.apache.kafka.common.KafkaException: Could not add partitions to transaction due to errors: {nfvAlarmJob-0=UNKNOWN_SERVER_ERROR}
              at org.apache.kafka.clients.producer.internals.TransactionManager$AddPartitionsToTxnHandler.handleResponse(TransactionManager.java:1230)
              at org.apache.kafka.clients.producer.internals.TransactionManager$TxnRequestHandler.onComplete(TransactionManager.java:1069)
              at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:109)
              at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:561)
              at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:553)
              at org.apache.kafka.clients.producer.internals.Sender.maybeSendAndPollTransactionalRequest(Sender.java:425)
              at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:311)
              at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:244)
              ... 1 common frames omitted
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            waykarp Prashant Waykar
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: