Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7739 Kafka Tiered Storage
  3. KAFKA-15168

Handle overlapping remote log segments in RemoteLogMetadata cache

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.6.0
    • None
    • None

    Description

      For a partition p0 and a given leader epoch, the remote log manager can upload duplicate segments due to leader change. RemoteLogMetadata cache should handle the duplicate segments which may affect the follower and consumer.

      (eg)

      L0 uploaded the segment PZyYVdsJQWeBAdBDPqkcVA at t0 for offset range 10 - 90
      L1 uploads the segment L5Ufv71IToiZYKgsluzcyA at t1 for offset range 5 - 100

      In the RemoteLogLeaderEpochState class, the offsetToId is a navigable map. It sorts the entries by start-offset which keeps the state as:

      (5 - 100) -> L5Ufv71IToiZYKgsluzcyA (T1)
      (10 - 90) -> PZyYVdsJQWeBAdBDPqkcVA (T0)

      For a fetch request with fetch-offset as 92, the RemoteLogLeaderEpochState will return the segment PZyYVdsJQWeBAdBDPqkcVA instead of L5Ufv71IToiZYKgsluzcyA, which doesn't have the respective offset and throws error back to the caller.

      Attachments

        Issue Links

          Activity

            People

              ckamal Kamal Chandraprakash
              ckamal Kamal Chandraprakash
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: