Skip to content

KAFKA-20902: Fix oldest-iterator-open-since-ms for same-ms iterators - #23126

Open
sumanpal97 wants to merge 1 commit into
apache:trunkfrom
sumanpal97:KAFKA-20902
Open

KAFKA-20902: Fix oldest-iterator-open-since-ms for same-ms iterators#23126
sumanpal97 wants to merge 1 commit into
apache:trunkfrom
sumanpal97:KAFKA-20902

Conversation

@sumanpal97

@sumanpal97 sumanpal97 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • Make the openIterators comparator total by tie-breaking on a per-iterator sequence id, so iterators opened in the same millisecond are tracked uniquely in metered store wrappers.
  • Add regression tests covering same-ms iterators (close older first, close younger first) and different iterator types sharing one openIterators set.

Fixes KAFKA-20902.

Test plan

  • ./gradlew :streams:build (compile, checkstyle, all streams unit tests)

  • New regression tests fail without the fix and pass with it:

    • MeteredKeyValueStoreTest.shouldTrackOldestOpenIteratorWhenTwoOpenedInSameMillisecond
    • MeteredKeyValueStoreTest.shouldTrackOldestOpenIteratorWhenYoungerIteratorInSameMillisecondIsClosedFirst
    • MeteredWindowStoreTest.shouldTrackOldestOpenIteratorWhenDifferentIteratorTypesOpenedInSameMillisecond

    Reviewers: @aliehsaeedii (flagged the issue in MINOR: De-duplicate Metered*WithHeaders read-only-record iterators #22975)

Make the openIterators comparator total by tie-breaking on a per-iterator
sequence id, so iterators opened in the same millisecond are tracked uniquely
in metered store wrappers. Add regression tests for same-ms iterator tracking.

Signed-off-by: sumanpal97 <sumanpal198@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

streams triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant