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

Matthias J. Sax commented on KAFKA-12815:
-----------------------------------------

[~ableegoldman] This bug does not affect FK-joins. I am actually also not sure, 
how many users would actually user `KTable.transformValues` _and_ use the 
record context metadata (I would assume that if people to this, we would have 
gotten a bug report from them). Don't have a strong opinion on back-porting to 
`2.8`, but I don't think that it's a critical bug, so maybe we can just leave 
it as-is?

For the long term, I am not sure either – I think it's ok to stay passive and 
only improve if users really start to raise it as an issue. Note, that the 
`RecordContext` JavaDocs already state that record information might not be 
available. So it's not a regression we are introducing with this fix, but it's 
a real fix, because we omit missing information instead of passing in incorrect 
information.

> KTable.transformValue might have incorrect record metadata
> ----------------------------------------------------------
>
>                 Key: KAFKA-12815
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12815
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Matthias J. Sax
>            Assignee: Matthias J. Sax
>            Priority: Major
>             Fix For: 3.0.0
>
>
> In the DSL, Kafka Streams applies an optimization for non-materialized 
> tables: when these are queried an upstream state store is accessed. To ensure 
> that the correct value is returned from the lookup, all intermediate 
> processors after the materialized store, and before the processor that 
> triggers the lookup are re-applied (cf `KTableValueGetter`).
> For re-applying DSL operators like filter/mapValues that works fine. However, 
> for transformValue(), the method is executed with the incorrect 
> `RecordContext` (note that DSL operators like filter don't have access to the 
> `RecordContext` and thus, are not subject to this bug). Instead of using the 
> record context from the value that was received from the upstream state store 
> (and that is re-processed), the transformer would see the context from the 
> record that triggered the lookup.
> Thus, the information about timestamp, offset, partition, topic name, and 
> headers is incorrect.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to