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

Multiple produce request failures causes invalid state transition in TransactionManager

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0.0
    • Component/s: None
    • Labels:

      Description

      When multiple produce requests fail (for instance when all inflight batches are expired), each will try to transition to ABORTABLE_ERROR.

      However, only the first transition will succeed, the rest will fail with the following 'invalid transition from ABORTABLE_ERROR to ABORTABLE_ERROR'.

      This will be caught in the sender thread and things will continue. However, the correct thing to do do is to allow multiple transitions to ABORTABLE_ERROR.

      [2017-06-09 01:22:39,327] WARN Connection to node 3 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
      [2017-06-09 01:22:39,958] TRACE Expired 2 batches in accumulator (org.apache.kafka.clients.producer.internals.Sender)
      [2017-06-09 01:22:39,958] DEBUG [TransactionalId my-first-transactional-id] Transition from state COMMITTING_TRANSACTION to error state ABORTABLE_ERROR (org.apache.kafka.clients.producer.internals.TransactionManager)
      org.apache.kafka.common.errors.TimeoutException: Expiring 250 record(s) for output-topic-0: 30099 ms has passed since batch creation plus linger time
      [2017-06-09 01:22:39,960] TRACE Produced messages to topic-partition output-topic-0 with base offset offset -1 and error: {}. (org.apache.kafka.clients.producer.internals.ProducerBatch)
      org.apache.kafka.common.errors.TimeoutException: Expiring 250 record(s) for output-topic-0: 30099 ms has passed since batch creation plus linger time
      [2017-06-09 01:22:39,960] ERROR Uncaught error in kafka producer I/O thread:  (org.apache.kafka.clients.producer.internals.Sender)
      org.apache.kafka.common.KafkaException: Invalid transition attempted from state ABORTABLE_ERROR to state ABORTABLE_ERROR
              at org.apache.kafka.clients.producer.internals.TransactionManager.transitionTo(TransactionManager.java:475)
              at org.apache.kafka.clients.producer.internals.TransactionManager.transitionToAbortableError(TransactionManager.java:288)
              at org.apache.kafka.clients.producer.internals.Sender.failBatch(Sender.java:602)
              at org.apache.kafka.clients.producer.internals.Sender.sendProducerData(Sender.java:271)
              at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:221)
              at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:162)
              at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                apurva Apurva Mehta
                Reporter:
                apurva Apurva Mehta
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: