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

FileRecords.read doesn't handle size > sizeInBytes when start is not zero

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.2.0, 0.11.0.0, 1.0.0
    • 1.1.0
    • log
    • None

    Description

      now the code is :
      def read(position: Int, size: Int): FileMessageSet =

      { ..... new FileMessageSet(file, channel, start = this.start + position, end = math.min(this.start + position + size, sizeInBytes())) }

      if this.start is not 0, the end is only the FileMessageSet's size, not the actually position of end position.
      the end parameter should be:
      end = math.min(this.start + position + size, this.start+sizeInBytes())

      Update Problem still remains in FileRecords.

      Attachments

        Issue Links

          Activity

            People

              jkreps Jay Kreps
              pengwei Pengwei
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: