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

[jira] [Reopened] (IGNITE-5795) @AffinityKeyMapped ignored if QueryEntity used

     [ https://issues.apache.org/jira/browse/IGNITE-5795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Cherkasov reopened IGNITE-5795:
---------------------------------------

it's still the issue for users, how should they get know this work around?

One of the users spent a plenty time trying to fix broken affinity, he asked us for help, I spent a plenty time too and found the solution only after consulting with Vova O.

We need to mention this in doc at least, like a big red warning or even warning in ignite output.





> @AffinityKeyMapped ignored if QueryEntity used
> ----------------------------------------------
>
>                 Key: IGNITE-5795
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5795
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Dmitry Karachentsev
>            Assignee: Alexey Kukushkin
>             Fix For: 2.3
>
>
> When cache configured with QueryEntity and used key type with @AffinityKeyMapped field, it will be ignored and wrong partition calculated. This happens because QueryEntity processing precedes key type registering in binary meta cache. On that step CacheObjectBinaryProcessorImpl#affinityKeyField called and unable to resolve type, so null returned and null putted in affKeyFields.
> On next put/get operation CacheObjectBinaryProcessorImpl#affinityKeyField will return null from affKeyFields, but should be affinity key field.
> Test that reproduces problem in [PR 2330|https://github.com/apache/ignite/pull/2330]
> To wrorkaround the issue, set IgniteConfiguration#setKeyConfiguration(), it will force registering key.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)