[
https://issues.apache.org/jira/browse/IGNITE-10017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16664965#comment-16664965
]
Roman Shtykh commented on IGNITE-10017:
---------------------------------------
Looks like using the same _preparingForCache_ we use to put the entry solves
the problem with access the map entry properly.
> 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)