Kafka
  1. Kafka
  2. KAFKA-761

Fetch request randomly returns 0 bytes when there's still data in the log

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.7.2
    • Fix Version/s: None
    • Component/s: consumer
    • Labels:
      None
    • Environment:
      centos 6

      Description

      I can't track the bug down in the code, but the behaviour has been hitting us for quite some time (on Kafka 0.7.2): sometimes, a new Simple Consumer object, on a new Fetch Request, returns an empty byte buffer (or a number of bytes considerably smaller than the buffer size), even if there's more data on disk.
      This happens randomly, with no errors, at different offsets in the same topic. Different consumer groups processing the same topic might get stuck at different offsets.
      There seems to be no correlation between empty responses and the offset, or the buffer size, or the log file size. At first we thought it only happened when reaching the end of a log file, before jumping to the next file, but it doesn't seem to be the case. It often happens in the middle of a file.

      Simply retrying the Fetch Request multiple times works quite reliably, after 2 or 3 empty fetches the consumer eventually gets unstuck (we check the size of the queue to see if there's more data before retrying).

        Activity

        Hide
        Lorenzo Alberton added a comment -

        Some more details: this happens with a moderately high number of topics (a few hundreds), when the consumers connect and disconnect quite often to fetch a few batches at a time.

        Show
        Lorenzo Alberton added a comment - Some more details: this happens with a moderately high number of topics (a few hundreds), when the consumers connect and disconnect quite often to fetch a few batches at a time.

          People

          • Assignee:
            Neha Narkhede
            Reporter:
            Lorenzo Alberton
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development