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

follower can hit OffsetOutOfRangeException during truncation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.0
    • 2.8.0, 2.7.1
    • core
    • None

    Description

      Currently, we have the following code path.

      log.truncateTo() => updateLogEndOffset() => updateHighWatermarkMetadata() => maybeIncrementFirstUnstableOffset() => convertToOffsetMetadataOrThrow() => read()

      This path seems problematic. The issue is that updateLogEndOffset() is called before loadProducerState() in log.truncateTo(). At that point, the producerState is not reflecting the truncated state yet and producerStateManager.firstUnstableOffset(called in maybeIncrementFirstUnstableOffset() to feed read()) could return an offset larger than the truncated logEndOffset, which will lead to OffsetOutOfRangeException.

       

      This issue is relatively rare since it requires truncation below the high watermark.

      Attachments

        Issue Links

          Activity

            People

              hachikuji Jason Gustafson
              junrao Jun Rao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: