You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Richa Bali (JIRA)" <ji...@apache.org> on 2017/06/06 06:00:25 UTC

[jira] [Commented] (IGNITE-5405) Null values in comparator for EvictableEntry

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

Richa Bali commented on IGNITE-5405:
------------------------------------

Sometimes in our project, we observed this issue for entries that were not even removed or evicted.

> Null values in comparator for EvictableEntry
> --------------------------------------------
>
>                 Key: IGNITE-5405
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5405
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 2.0
>            Reporter: Richa Bali
>         Attachments: Ignite_Project.7z, No null value logs.txt, Null value logs.txt
>
>
> EvictableEntry has null value for corresponding key.
> *SCENARIO:*
> We cache an object with key as a unique identifier (member variable of the object) and value as the object itself.
> EvictionPolicy used is the SortedEvictionPolicy with our custom comparator.
> Entry is *removed* from cache for some keys but those entries are subsequently passed to comparator with key but null object.
> Sample project is attached.
> *Details of sample project:*
> * DemoEntry class containing mId and mTimeUTC as member variables. mId is the unique identifier used as key for cache and mTimeUTC is the member variable used in DemoComparator.
> * DemoComparator is used for SortedEvictionPolicy on the basis of mTimeUTC.
> * IgniteEvictionListener is the listener to check if the entries are evicted.
> Sample run:
> *DemoProject:*
> * 10 entries are added to cache for which the eviction policy used is SortedEvictionPolicy on the basis of DemoComparator. 
> * Size is set to 5.
> * 2 of the entries are removed and data in cache is printed.
> Note: Removed keys are not used to fetch the data from cache.
> *Observations:*
> Sometimes, null value for the key (not null key) is passed to comparator. Since the data used in sample project is limited to 10 entries only, it is not reproducible in all the runs. It occurs sometimes (may be because of asynchronous behavior).
> But if we try to retrieve even the removed value by commenting lines 62-64 of DemoProject, it is usually reproducible.
> Attached are the sample logs where we retrieved only those values that were not removed.
> * "Null value logs.txt": logs when null value scenario occurred.
> * "No null value logs.txt": logs when null value scenario didn't occur.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)