You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jess Jin (Jira)" <ji...@apache.org> on 2026/08/06 18:58:00 UTC

[jira] [Created] (KAFKA-20902) Streams metered stores: oldest-iterator-open-since-ms can be wrong when two iterators open in the same millisecond

Jess Jin created KAFKA-20902:
--------------------------------

             Summary: Streams metered stores: oldest-iterator-open-since-ms can be wrong when two iterators open in the same millisecond
                 Key: KAFKA-20902
                 URL: https://issues.apache.org/jira/browse/KAFKA-20902
             Project: Kafka
          Issue Type: Bug
          Components: streams
            Reporter: Jess Jin


{{openIterators}} is a {{ConcurrentSkipListSet}} keyed only by {{startTimestamp()}} (ms resolution). Two iterators opened in the same millisecond compare equal, so the second {{add()}} is a silent no-op and a {{remove()}} on close can evict the still-open one — the {{oldest-iterator-open-since-ms}} gauge then under-reports (may skip a still-open iterator or return 0). {{num-open-iterators}} is unaffected (separate {{LongAdder}}); iterators still close correctly, so it's a metric-accuracy issue, not a leak. Affects all metered store wrappers. *Fix:* make the comparator total (tie-break on a per-iterator sequence id). Found in PR [#22975|https://github.com/apache/kafka/pull/22975] review [{{r3730260330}}|https://github.com/apache/kafka/pull/22975#discussion_r3730260330].



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