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

Guozhang Wang commented on KAFKA-13647:
---------------------------------------

TLDR: I think the `NO_FILE_OPENS` statistics is right, what's wrong is that 
`NO_FILE_CLOSES` is never recorded..

I did a quick check on rocksDB code and here's all the places `NO_FILE_OPENS` 
is recorded:

1) 
https://github.com/facebook/rocksdb/blob/2e09a54c4fb82e88bcaa3e7cfa8ccbbbbf3635d5/db/blob/blob_file_cache.cc#L69
2) 
https://github.com/facebook/rocksdb/blob/fc9d4071f0c504e107d7e1e11ed173175003a99b/db/table_cache.cc#L117-L125

But there's zero places where `NO_FILE_CLOSES` is recorded.

I searched in the rocksDB commit history and found that the recording seems 
lost during a commit, and filed a ticket in rocksDB: 
https://github.com/facebook/rocksdb/issues/9514 that contains more context.


> RocksDb metrics 'number-open-files' is not correct
> --------------------------------------------------
>
>                 Key: KAFKA-13647
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13647
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 3.0.0
>            Reporter: Sylvain Le Gouellec
>            Priority: Major
>         Attachments: image-2022-02-07-16-06-25-304.png, 
> image-2022-02-07-16-06-39-821.png, image-2022-02-07-16-06-53-164.png
>
>
> We were looking at RocksDB metrics and noticed that the {{number-open-files}} 
> metric behaves like a counter, rather than a gauge. 
> Looking at the code, we think there is a small error in the type of metric 
> for that specific mbean (should be a value metric rather than a sum metric).
> See [ 
> https://github.com/apache/kafka/blob/ca5d6f9229c170beb23809159113037f05a1120f/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.java#L482|https://github.com/apache/kafka/blob/99b9b3e84f4e98c3f07714e1de6a139a004cbc5b/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.java#L482]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to