[
https://issues.apache.org/jira/browse/KAFKA-4863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926122#comment-15926122
]
ASF GitHub Bot commented on KAFKA-4863:
---------------------------------------
GitHub user dguy opened a pull request:
https://github.com/apache/kafka/pull/2688
KAFKA-4863: Querying window store may return unwanted keys. Backport to
0.10.2
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dguy/kafka kafka-4863-10.2
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/2688.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2688
----
commit 5c6900f7e35ef3dc33be8fd750d6f0a0d700f458
Author: Damian Guy <[email protected]>
Date: 2017-03-15T12:05:07Z
backport to 0.10.2
----
> Querying window store may return unwanted keys
> ----------------------------------------------
>
> Key: KAFKA-4863
> URL: https://issues.apache.org/jira/browse/KAFKA-4863
> Project: Kafka
> Issue Type: Bug
> Components: streams
> Affects Versions: 0.10.2.0
> Reporter: Xavier Léauté
> Assignee: Damian Guy
> Priority: Critical
>
> Using variable length keys in a window store may cause unwanted results to be
> returned when querying certain ranges.
> Below is a test case for {{RocksDBWindowStoreTest}} that shows the problem.
> It fails, returning {{\[0001, 0003, 0002, 0004, 0005\]}} instead of {{\[0001,
> 0003, 0005\]}}.
> {code:java}
> @Test
> public void testPutAndFetchSanity() throws IOException {
> final RocksDBWindowStoreSupplier<String, String> supplier =
> new RocksDBWindowStoreSupplier<>(
> "window", 60 * 1000L * 2, 3,
> true, Serdes.String(), Serdes.String(),
> windowSize, true, Collections.<String, String>emptyMap(),
> false
> );
> final WindowStore<String, String> store = supplier.get();
> store.init(context, store);
> try {
> store.put("a", "0001", 0);
> store.put("aa", "0002", 0);
> store.put("a", "0003", 1);
> store.put("aa", "0004", 1);
> store.put("a", "0005", 60000);
> assertEquals(Utils.mkList("0001", "0003", "0005"),
> toList(store.fetch("a", 0, Long.MAX_VALUE)));
> } finally {
> store.close();
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)