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

LeaderEpochFileCache.endOffsetFor() should check for UNDEFINED_EPOCH explicitly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.0.0
    • Fix Version/s: 0.11.0.3, 1.0.2, 1.1.1, 2.0.0
    • Component/s: core
    • Labels:
      None

      Description

      In LeaderEpochFileCache.endOffsetFor() , we have the following code.

       

       

      if (requestedEpoch == latestEpoch) {
       leo().messageOffset
      

       

      In the case when the requestedEpoch is UNDEFINED_EPOCH and latestEpoch is also UNDEFINED_EPOCH, we return leo. This will cause the follower to truncate to a wrong offset. If requestedEpoch is UNDEFINED_EPOCH, we need to request UNDEFINED_EPOCH_OFFSET.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                apovzner Anna Povzner
                Reporter:
                junrao Jun Rao
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: