[ https://issues.apache.org/jira/browse/IGNITE-5505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16089898#comment-16089898 ]
Vladimir Ozerov edited comment on IGNITE-5505 at 7/17/17 2:25 PM: ------------------------------------------------------------------ [~kukushal], [~agura], Fix is wrong. New logic will either return or not return affinity key field depending on whether class exists on the node or not. Clients often have classes, servers don't. This is inconsistent behavior. Correct fix would be to add {{affinityKey}} property to {{BinaryTypeConfiguration}}, or so. But there is a much bigger problem - affinity key field name *should not* be part of metadata at all. This is a huge design flaw in Ignite. Instead, it should be defined on per-cache level for every type. I tried to partially fix this introducing {{CacheConfiguration.keyConfiguration}} property. Affinity key field name will be removed from binary metadata as soon as we can break compatibility (i.e. during next major release). For now I propose to close the ticket, as any fix would be wrong. was (Author: vozerov): [~kukushal], [~agura], Fix is wrong. New logic will either return or not return affinity key field depending on whether class exists on the node or not. Clients often have classes, servers don't. This is inconsistent behavior. Correct fix would be to add {{affinityKey}} property to {{BinaryTypeConfiguration}}, or so. But there is a much bigger problem - affinity key field name *should not* be part of metadata at all. This is a huge design flaw in Ignite. Instead, it should be defined on per-cache level for every type. I tried to partially fix this introducing {{CacheConfiguration.keyConfiguration}} property. Affinity key field name will be removed from binary metadata as soon as we can break compatibility (i.e. during next major release). For not I propose to close the ticket, as any fix would be wrong. > @AffinityKeyMapped annotation is ignored if class names are configured on > BinaryConfiguration > --------------------------------------------------------------------------------------------- > > Key: IGNITE-5505 > URL: https://issues.apache.org/jira/browse/IGNITE-5505 > Project: Ignite > Issue Type: Bug > Affects Versions: 1.7 > Reporter: Andrey Gura > Assignee: Alexey Kukushkin > Fix For: 2.2 > > > {{@AffinityKeyMapped}} annotation on key class field is ignored in case when > class names passed to {{inaryConfiguration}} via {{setClassNames()}} method. > The problem is that Ignite uses {{IgniteConfiguration.cacheKeyCfg}} during > {{BinaryContext.configure()}} execution and doesn't check class fileds on > {{@AffinityKeyMapped}} annotation. > Possible solution: check class fields on {{@AffinityKeyMapped}} annotation if > there is no any mapping for cache key type. -- This message was sent by Atlassian JIRA (v6.4.14#64029)