Search code examples
apache-kafkakafka-consumer-api

why kafka consumer gets OFFSET_NOT_AVAILABLE error


While the consumer group working normally and consuming from the topic flawlessley, you might see every now and then OFFSET_NOT_AVAILABLE error and after awhile it got disappear without any intervention -most of the time-, why would you see such error?


Solution

  • This happened when there is a transfer of the partition leadership from broker to another and the high watermark of the new leader is not yet synced with the original leader.

    https://kafka.apache.org/protocol.html#protocol_error_codes

    https://levelup.gitconnected.com/high-water-mark-hwm-in-kafka-offsets-5593025576ac