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

Purgatory Size and Num.Delayed.Request metrics are incorrect

    XMLWordPrintableJSON

Details

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

    Description

      The request purgatory used two atomic integers "watched" and "unsatisfied" to record the purgatory size ( = watched + unsatisfied) and number of delayed requests ( = unsatisfied). But due to some race conditions these two atomic integers are not updated correctly, result in incorrect metrics.

      Proposed solution: to have a cleaner semantics, we can define the "purgatory size" to be just the number of elements in the watched lists, and the "number of delayed requests" to be just the length of the expiry queue. And instead of using two atomic integeres we just compute the size of the lists / queue on the fly each time the metrics are pulled. This may use some more CPU cycles for these two metrics but should be minor, and the correctness is guaranteed.

      Attachments

        1. KAFKA-1616.patch
          3 kB
          Guozhang Wang
        2. KAFKA-1616_2014-08-28_10:12:17.patch
          6 kB
          Guozhang Wang
        3. KAFKA-1616_2014-09-01_14:41:56.patch
          11 kB
          Guozhang Wang
        4. KAFKA-1616_2014-09-02_12:58:07.patch
          14 kB
          Guozhang Wang
        5. KAFKA-1616_2014-09-02_13:23:13.patch
          14 kB
          Guozhang Wang
        6. KAFKA-1616_2014-09-03_12:53:09.patch
          16 kB
          Guozhang Wang
        7. KAFKA-1616_2014-09-04_13:26:02.patch
          23 kB
          Guozhang Wang

        Activity

          People

            guozhang Guozhang Wang
            guozhang Guozhang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: