Kafka
  1. Kafka
  2. KAFKA-304

Simple Consumer message set behavior broken on 0.8 branch

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Not a Problem
    • Affects Version/s: 0.8.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The testZKSendWithDeadBroker() test commented out in ProducerTest actually exposes a bug with path KAFKA-240. It seems that even when the broker has some messages for a topic partition, the simple consumer doesn't return those.

      I've simplified this test and attached a diff to this bug. Apply it on 0.8 branch to reproduce this.

        Activity

        Hide
        Neha Narkhede added a comment -

        Prashanth, that looks like a bug in the test itself.

        Show
        Neha Narkhede added a comment - Prashanth, that looks like a bug in the test itself.
        Hide
        Prashanth Menon added a comment -

        Modified the test with the change and it seems to be passing. Can you double-check, Neha? The change is on line 215.

        Show
        Prashanth Menon added a comment - Modified the test with the change and it seems to be passing. Can you double-check, Neha? The change is on line 215.
        Hide
        Prashanth Menon added a comment -

        Hi Neha,

        I took a glancing look at the test and I think there might be a mistake. The line that reads: "assertEquals(message, messageSet.next.message)" should actually be "assertEquals(message, messageAndOffset.message)". The former progresses the iterator a second time after the preceeding line so two messages are consumed within one iteration of the loop, wherare the latter looks at one message within the current iteration alone. I'll take a closer look when I get a chance.

        Show
        Prashanth Menon added a comment - Hi Neha, I took a glancing look at the test and I think there might be a mistake. The line that reads: "assertEquals(message, messageSet.next.message)" should actually be "assertEquals(message, messageAndOffset.message)". The former progresses the iterator a second time after the preceeding line so two messages are consumed within one iteration of the loop, wherare the latter looks at one message within the current iteration alone. I'll take a closer look when I get a chance.
        Hide
        Neha Narkhede added a comment -

        The test creates a topic new-topic with partitions on one broker. The producer sends 2 messages to one partition on that broker. The file message set on that broker returns 2 messages, but simple consumer pulling from the same broker returns only 1 message.

        Show
        Neha Narkhede added a comment - The test creates a topic new-topic with partitions on one broker. The producer sends 2 messages to one partition on that broker. The file message set on that broker returns 2 messages, but simple consumer pulling from the same broker returns only 1 message.

          People

          • Assignee:
            Prashanth Menon
            Reporter:
            Neha Narkhede
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development