Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-913

CoordinatorStreamSystemConsumer drops messages when they are considered equivalent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.10.1
    • None
    • None

    Description

      When CoordinatorStreamSystemConsumer bootstraps, it adds the messages to a LinkedHashSet ("bootstrappedStreamSet"). The intent seems to be:
      1. Messages will be processed in the order they were consumed.
      2. Only the latest copy of a message will be stored.

      That second assumption turns out to be false with the current implementation. In Java, Set.add() only adds an element if it doesn't already exist in the Set. Further, CoordinatorStreamMessage.equals() relies on the key set and values, but not the message offset or timestamp, so the following set of messages could occur:

      key1 -> value1 // added to bootstrappedStreamSet
      key1 -> value2 // added to bootstrappedStreamSet
      key1 -> value1 // duplicate to first message, not added

      Thus the final state will be (incorrectly):
      key1 -> value2

      Attachments

        1. SAMZA-913.patch
          6 kB
          Jake Maes

        Issue Links

          Activity

            People

              jmakes Jake Maes
              jmakes Jake Maes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: