nicktelford opened a new pull request, #22652: URL: https://github.com/apache/kafka/pull/22652
In-memory window and session stores need the same transactional, isolation-aware behaviour KIP-892 introduced for the key-value store: when transactional state stores are enabled (EOS), writes must be staged in a transaction buffer and only applied to the store on commit, and interactive queries must be able to read at `READ_COMMITTED` (ignoring staged writes) or `READ_UNCOMMITTED`. This adds `InMemoryWindowTransactionBuffer` and `InMemorySessionTransactionBuffer`, each extending `AbstractTransactionBuffer` with a composite key that encodes the store's ordering — timestamp/key for windows, endTime/key/startTime for sessions. `InMemoryWindowStore` and `InMemorySessionStore` route reads and writes through their buffer when transactional state stores are enabled, and report their staged size via `approximateNumUncommittedBytes()`. Each buffer implements `newBaseSnapshotIterator` so non-owner (interactive-query) reads get a point-in-time view: the bounded range of the backing segment map is eagerly deep-copied under the snapshot read lock, isolating the returned iterator from concurrent owner mutation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
