[ 
https://issues.apache.org/jira/browse/KAFKA-21609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18150904#comment-18150904
 ] 

sanghyeok An commented on KAFKA-21609:
--------------------------------------

[~mjsax] 

Thanks for taking the time to look into this!

Both issues can expose an uncommitted value to a READ_COMMITTED read. In 
KAFKA-21505, the format-converting adapter doesn’t forward 
readOnly(READ_COMMITTED) to the underlying store. In this issue, an IQv2 
KeyQuery can return the cached value before it reaches the underlying store, 
even when there’s no format-converting adapter. Given that difference, it seems 
reasonable to keep the tickets separate and link them as related...!

What do you think?

> 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
>            Priority: Minor
>
> 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