sanghyeok An created KAFKA-21609:
------------------------------------

             Summary: Kafka Streams IQv2 KeyQuery returns an uncommitted value 
on a cache hit with READ_COMMITTED isolation
                 Key: KAFKA-21609
                 URL: https://issues.apache.org/jira/browse/KAFKA-21609
             Project: Kafka
          Issue Type: Bug
          Components: clients, streams
            Reporter: sanghyeok An
            Assignee: sanghyeok An


h3. *Scenario*
 # Enable caching for a RocksDB-backed key-value store in a Kafka Streams 
application with enable.transactional.statestores=true.
 # Write 10 to key K and commit.
 # Write 20 to the same key. Before the next commit, query K using an IQv2 
KeyQuery with READ_COMMITTED isolation and the default unbounded PositionBound.

h3. *Problem*

The query should return 10, the last committed value. On a cache hit, however, 
CachingKeyValueStore returns 20 without checking the requested isolation level.

The same behavior occurs after flushCache() if the entry remains in the cache. 
At that point, 20 has reached the RocksDB transaction buffer and is still 
pending commit. The underlying store returns 10 for the same READ_COMMITTED 
query.

The State Store Caching section of KIP-892 states that "{*}IQ READ_COMMITTED 
reads ignore the record cache{*}." The KIP specifies the cache-bypass behavior 
without prescribing a particular method call. In CachingKeyValueStore, 
wrapped() provides access to the underlying store



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to