You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2014/09/01 23:42:20 UTC

[jira] [Commented] (KAFKA-1616) Purgatory Size and Num.Delayed.Request metrics are incorrect

    [ https://issues.apache.org/jira/browse/KAFKA-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14117742#comment-14117742 ] 

Guozhang Wang commented on KAFKA-1616:
--------------------------------------

Updated reviewboard https://reviews.apache.org/r/25155/diff/
 against branch origin/trunk

> Purgatory Size and Num.Delayed.Request metrics are incorrect
> ------------------------------------------------------------
>
>                 Key: KAFKA-1616
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1616
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Guozhang Wang
>            Assignee: Guozhang Wang
>             Fix For: 0.9.0
>
>         Attachments: KAFKA-1616.patch, KAFKA-1616_2014-08-28_10:12:17.patch, KAFKA-1616_2014-09-01_14:41:56.patch
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)