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

Fix commit() in zk consumer for compressed messages

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.0
    • Component/s: None
    • Labels:
      None

      Description

      In 0.7.x and earlier versions offsets were assigned by the byte location in the file. Because it wasn't possible to directly decompress from the middle of a compressed block, messages inside a compressed message set effectively had no offset. As a result the offset given to the consumer was always the offset of the wrapper message set.

      In 0.8 after the logical offsets patch messages in a compressed set do have offsets. However the server still needs to fetch from the beginning of the compressed messageset (otherwise it can't be decompressed). As a result a commit() which occurs in the middle of a message set will still result in some duplicates.

      This can be fixed in the ConsumerIterator by discarding messages smaller than the fetch offset rather than giving them to the consumer. This will make commit work correctly in the presence of compressed messages (finally).

        Attachments

        1. kafka-546-v1.patch
          8 kB
          Swapnil Ghike
        2. kafka-546-v2.patch
          8 kB
          Swapnil Ghike
        3. kafka-546-v3.patch
          10 kB
          Swapnil Ghike
        4. kafka-546-v4.patch
          10 kB
          Swapnil Ghike
        5. kafka-546-v5.patch
          10 kB
          Swapnil Ghike

          Activity

            People

            • Assignee:
              swapnilghike Swapnil Ghike
              Reporter:
              jkreps Jay Kreps
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: