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

Neil Green edited comment on KAFKA-9611 at 2/27/20 2:40 PM:
------------------------------------------------------------

I think it is a bug. One received message results in two messages being 
published, one of which has a value which has never been correct. The number of 
questions about this behaviour on SO suggests that it is, at the very best, 
extremely surprising for a lot of users. When both the adder and subtractor are 
executed on the same node it should be possible for both of them to be applied 
before emitting the result.


was (Author: neilgreen):
I think it is a bug. One received message results in two messages being 
published, one of which has a value which has never been correct. The number of 
questions about this behaviour on SO suggests that it is, at the very best, 
extremely surprising for a lot of users. When both the adder and subtractor are 
executed on the same node it should be possible for them to be applied before 
emitting the result.

> KGroupedTable.aggregate(...) emits incorrect values
> ---------------------------------------------------
>
>                 Key: KAFKA-9611
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9611
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.4.0
>            Reporter: Neil Green
>            Priority: Major
>
> I've run into what appears to be undesirable behaviour in a streams app.
> I have a KTable produced from a topic. The table contains entries like 
> "abc1234/signal1" : 1, "abc1234/signal2" : 3
>  The key is "id/signal name" and the value is an int. I want to produce a 
> aggregate ktable containing the sum all of the
>  signals for a given id.
> {{So if source ktable contains:}}
> {{+------------------+--+}}
>  {{| abc1234/signal1 | 2 |}}
>  {{| abc1234/signal2 | 4 |}}
>  {{| abc4566/signal1 | 3 |}}
>  {{+------------------+--+}}
> {{Then the output should contain}}
> {{+----------+--+}}
>  {{| abc1234 | 6 |}}
>  {{| abc4566 | 3 |}}
>  {{+----------+--+}}
> {{On a change}}
> {{+------------------+--+}}
>  {{| abc1234/signal1 | 3 |}}
>  {{+------------------+--+}}
>  {{```}}
>  {{I would expect the change}}
>  {{```}}
>  {{+----------+--+}}
>  {{| abc1234 | 7 |}}
>  {{+----------+--+}}
> {{to be published.}}
> In fact there are two changelog entries published
> {{+----------+--+}}
>  {{| abc1234 | 4 | // This is incorrect. The sum of the signals is never 4.}}
>  {{+----------+--+}}
> Then
> {{+----------+--+}}
>  {{| abc1234 | 7 |}}
>  {{+----------+--+}}



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

Reply via email to