Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uniqe:ever window emits many duplicates. is this a bug ? or is something wrong with the script ? #1777

Open
rzorzorzo opened this issue Apr 1, 2022 · 0 comments

Comments

@rzorzorzo
Copy link

Description:
unique:ever window emits unexpectedly many duplicats

Affected Siddhi Version:
siddhi-tooling-5.1.0
OS, DB, other environment details and versions:
win 10
Steps to reproduce:
@app:name("RaceRank")

@app:description("Description of the plan")

@sink(type='log', prefix='IN')
@source(
type='kafka',
topic.list='kafka_waypoint_topic',
partition.no.list='0',
threading.option='single.thread',
group.id='group',
is.binary.message='true',
bootstrap.servers='localhost:9092',
@Map(type = 'json'))
define stream RaceWaypointStream (timestamp long, lineId string, waypointId string, vehicleId string);

@sink(type='log', prefix='MID')
define stream RankStream(lineId string, ranking string, vehicleId string, timestamp long);

@sink(type='log', prefix='OUT')
-- @sink(type='kafka',
-- topic='kafka_rank_topic',
-- is.binary.message='true',
-- bootstrap.servers='localhost:9092',
-- is.synchronous='true',
-- @Map(type = 'json')
-- )
define stream RankOutStream(timestamp long, lineId string, sortedRank string);

@purge(enable='true', interval='10 sec', idle.period='1 min')
partition with ( lineId of RaceWaypointStream )
begin
from RaceWaypointStream
select lineId, str:concat(waypointId, '$', convert(timestamp,'string'), '$', vehicleId,'$',lineId) as ranking, vehicleId, timestamp
insert into RankStream;

from RankStream#window.unique:ever(vehicleId)

-- select timestamp, lineId, convert(list:sort(list:collect(ranking), 'DESC'), 'string') as sortedRank
select timestamp, lineId, ranking as sortedRank
insert into RankOutStream;
end;

a producer with 100 kafka-producers running each in a thread produce 1 events per 10 ms. all events have different content.

as output we first see
that the loggers log in the expected order:
IN, MID, OUT, IN, MID, OUT, ....
at some point we see:
OUT, OUT, OUT, ... with the same event being duplicated up to 50-80x which is causing a congestion of the test system.

Question: is this an issue with the script ? or a bug ?

Related Issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant