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

LogSemgent.truncateTo() should always resize the index file

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0.2, 0.10.1.1, 0.10.2.1, 0.11.0.2, 1.0.0
    • Fix Version/s: 1.1.0
    • Component/s: core
    • Labels:
      None

      Description

      The bug is the following:

      1. Initially on a follower broker there are two segments 0 and segment 10000. Segment 0 is empty (maybe due to log compaction)
      2. log is truncated to 0.
      3. LogSemgent.Truncate() will not find a message to truncate in segment 0, so it will skip resizing the index/timeindex files. 
      4. When a new message is fetched, Log.maybeRoll() will try to roll a new segment because the index file of segment 0 is already full (max size is 0)
      5. After creating the new segment 0, the replica fetcher thread finds that there is already a segment 0 exists. So it just throws exception and dies.

      The fix would be let the broker make sure the index files of active segments are always resized properly.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hachikuji Jason Gustafson
                Reporter:
                becket_qin Jiangjie Qin
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: