Skip to content

KAFKA-20796: Fix num-open-iterators metric for timestamped range queries#22809

Open
dino2895 wants to merge 1 commit into
apache:trunkfrom
dino2895:KAFKA-20796
Open

KAFKA-20796: Fix num-open-iterators metric for timestamped range queries#22809
dino2895 wants to merge 1 commit into
apache:trunkfrom
dino2895:KAFKA-20796

Conversation

@dino2895

Copy link
Copy Markdown

MeteredTimestampedKeyValueStoreIterator registered itself in
openIterators, but did not update numOpenIterators. As a result,
iterators created by IQv2 RangeQuery and TimestampedRangeQuery
were not included in the num-open-iterators metric.

This change increments the counter when the iterator is created and
decrements it when the iterator is closed.

Regression tests verify that the metric transitions from 0 to 1 while
the iterator is open and returns to 0 after it is closed for both query
types.

Testing:

  • ./gradlew :streams:spotlessJavaCheck
  • ./gradlew :streams:checkstyleMain :streams:checkstyleTest
  • ./gradlew :streams:test

@github-actions github-actions Bot added triage PRs from the community streams small Small PRs labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved small Small PRs streams triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants