You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Jakob Homan (JIRA)" <ji...@apache.org> on 2014/07/04 02:10:34 UTC

[jira] [Commented] (SAMZA-321) LevelDbKeyValueStore range seems to be broken

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

Jakob Homan commented on SAMZA-321:
-----------------------------------

The fix should be reasonably simple (have the next function use the same test as the hasNext), and this is an edge case for badly written apps that don't correctly use the iterator.  However, the code can still return incorrect results, so we should add this to a 0.7.1 release.

> LevelDbKeyValueStore range seems to be broken
> ---------------------------------------------
>
>                 Key: SAMZA-321
>                 URL: https://issues.apache.org/jira/browse/SAMZA-321
>             Project: Samza
>          Issue Type: Bug
>          Components: kv
>            Reporter: Chinmay Soman
>            Priority: Critical
>
> The current implementation does this by returning an instance of:
> LevelDbRangeIterator.
> This custom iterator implements the range (from, to) by only guarding the hasNext function. This means that as long as the caller calls hasNext before a next, everything will work fine.
> However, if the caller invokes next() directly, then the range is not obeyed. Essentially, we can retrieve elements beyond the specified range (all the way to the end). 
> I tested this by tweaking testRange function of TestKeyValueStores
> - Get an iterator over a defined range (f to u)
> - Display all the values using only iter.next (until we get an exception)
> This method printed all the values from 'f' to 'z' instead of 'f' to 'u'



--
This message was sent by Atlassian JIRA
(v6.2#6252)