Jeetu Bethina created KAFKA-5466:
------------------------------------
Summary: Unable to fetch elements from WindowStore when timestamp
is before the first inserted Elem timestamp
Key: KAFKA-5466
URL: https://issues.apache.org/jira/browse/KAFKA-5466
Project: Kafka
Issue Type: Bug
Components: streams
Affects Versions: 0.10.2.1
Reporter: Jeetu Bethina
I am unable to fetch elements that are inserted with a timestamp before the
timestamp of the first element inserted into the WindowStore.
This affects a newly created WindowStore or one that is restored from a
changelog topic.
The method I use to insert into the Window Store is
http://docs.confluent.io/3.2.1/streams/javadocs/org/apache/kafka/streams/state/WindowStore.html#put-K-V-long-
Looking into the code, the issue might be with how the minSegmentId is being
calculated here.
https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/state/internals/Segments.java#L88
Something like the below fixes the issue with regards to the WindowStore but I
am not sure what the implications would be for Streams as a whole.
if (minSegmentId == Long.MAX_VALUE) {
minSegmentId = maxSegmentId;
} else {
minSegmentId = segmentId < minSegmentId ? segmentId : minSegmentId;
}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)