Jess Jin created KAFKA-20796:
--------------------------------

             Summary: num-open-iterators metric under-counts iterators from 
MeteredTimestampedKeyValueStore
                 Key: KAFKA-20796
                 URL: https://issues.apache.org/jira/browse/KAFKA-20796
             Project: Kafka
          Issue Type: Improvement
          Components: streams
            Reporter: Jess Jin


MeteredTimestampedKeyValueStoreIterator(streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredTimestampedKeyValueStore.java:301)
 registers itself in {{openIterators}} but never calls 
{{{}numOpenIterators.increment () / decrement(){}}}.

As a result, iterators opened against a plain (non-headers) timestamped 
key-value store are invisible to the '{{{}num-open-iterators{}}}' metric while 
still visible to '{{{}oldest-iterator-open-since-ms{}}}' - the two gauges 
disagree about how many iterators are open.

Fix: call {{numOpenIterators.increment()}} in the constructor and 
{{numOpenIterators.decrement()}} in {{close()}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to