You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/10/26 10:00:00 UTC

[jira] [Commented] (IGNITE-10017) Infinite loop with 3rd party persistency, keepBinary and no value for the key

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

ASF GitHub Bot commented on IGNITE-10017:
-----------------------------------------

GitHub user shroman opened a pull request:

    https://github.com/apache/ignite/pull/5085

    IGNITE-10017: Fix for infinite loop with 3rd party persistency, keepB…

    …inary and no value for the key.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shroman/ignite IGNITE-10017

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/5085.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 #5085
    
----
commit bbc0a97ef8b2f31f7fab588608dd87d61d570f18
Author: shroman <rs...@...>
Date:   2018-10-26T09:49:07Z

    IGNITE-10017: Fix for infinite loop with 3rd party persistency, keepBinary and no value for the key.

----


> Infinite loop with 3rd party persistency, keepBinary and no value for the key
> -----------------------------------------------------------------------------
>
>                 Key: IGNITE-10017
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10017
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.6
>            Reporter: Roman Shtykh
>            Assignee: Roman Shtykh
>            Priority: Critical
>
> Basically, it happens because _GridCacheAdapter#clearReservationsIfNeeded_ fails to clear its local map.
>  
> The problem occurs when _withKeepBinary_ is set and _IgniteBiTuple_ is used as a key, but the value for the key is not available. The execution path goes through _GridDhtCacheAdapter#getDhtAllAsync_ -> _GridCacheAdapter#getAllAsync0_, for instance if you have an affinityCall and execute get() from within.
>  
> What happens is
>  # On get operation, keys are stored in the local map of _GridCacheAdapter_. For this, _UserKeyCacheObjectImpl#prepareForCache_ creates _KeyCacheObjectImpl_ with an unmarshalled val (BinaryObject), which is different from that of _UserKeyCacheObjectImpl_ (val is BiTuple here) that is used further as a key to retrieve the value from the map.
>  # _GridCacheAdapter#clearReservationsIfNeeded_ is called to clear the map from keys for which values were not found. It uses _UserKeyCacheObjectImpl_ to check the map, but can’t peek and remove even if the key is in the map (hashes won’t match). The key is left in the map.
>  # The problem comes with the 2^nd^ get:
> - we check the key is not in the map and create a new one, then BOOM! loops while _putIfAbsent == null_ succeeds (but it won’t)
> All these data types are ok – [https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java#L212-L239]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)