conduktor.io ↗

Kafka Exception OutOfOrderSequenceException

org.apache.kafka.common.errors.OutOfOrderSequenceException
Non-retriable Producer

This exception indicates that the broker received an unexpected sequence number from the producer, which means that data may have been lost. If the producer is configured for idempotence only (i.e. if enable.idempotence is set and no transactional.id is configured), it is possible to continue sending with the same producer instance, but doing so risks reordering of sent records. For transactional producers, this is a fatal error and you should close the producer.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.common.errors.OutOfOrderSequenceException: The broker received an out of order sequence number.

Diagnostic Commands

# Look for sequence number errors in logs grep 'OUT_OF_ORDER_SEQUENCE\|OutOfOrderSequence\|sequence number' /var/log/kafka/server.log | tail -20 # Check for under-replicated partitions kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic <topic> 2>&1 | grep -E 'Isr|UnderReplicated'

Related

Protocol error: OUT_OF_ORDER_SEQUENCE_NUMBER (code 45)

Related Producer exceptions: BufferExhaustedException · InvalidProducerEpochException · RecordBatchTooLargeException · RecordTooLargeException · TransactionAbortedException · UnknownProducerIdException · UnsupportedForMessageFormatException

Hitting OutOfOrderSequenceException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.