[
https://issues.apache.org/jira/browse/IGNITE-3191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15621775#comment-15621775
]
Taras Ledkov commented on IGNITE-3191:
--------------------------------------
Root cause:
at the {{BinaryContext.registerUserClassDescriptor}} metadata is not updated on
deserialize.
So, the fail case is:
1. *New node* writes object to the cache, update system cache & local maps with
*new-schema*;
2. *Old node* reads the object from binary. Create local
{{BinaryClassDescriptor}} with *old-schema* as a stable schema. *New-chema* is
available at the schemes registry. Does't update metadata (doesn't merge
*old-schema* & *new-schema*);
3. *Old node* writes object to the cache. The new {{BinaryClassDescriptor}}
isn't created because the descriptor is added to the local maps at the *step*
2. The stable *old-schema* is used.
4. *New-node* cannot deserialize the object with *old-shema*.
The suggestion fix from Vladimir updates metadata on the *step 3*.
So, in case the object has been created on the old node then the object is
created on the new-node all works properly because new node updates the system
cache with *new-schema*.
Conclusion:
1. I guess we have to fix the metadata & system caches update on the *step 2*
(when the local instance of the {{BinaryClassDescriptor}} is created the
first.) to prevent this problem in the future.
2. The fix for fields ordering should be switched by system property until the
backward compatibility is required.
> BinaryObjectBuilder: binary schema id depends on the order of fields addition
> -----------------------------------------------------------------------------
>
> Key: IGNITE-3191
> URL: https://issues.apache.org/jira/browse/IGNITE-3191
> Project: Ignite
> Issue Type: Bug
> Reporter: Denis Magda
> Assignee: Taras Ledkov
> Priority: Critical
> Fix For: 1.8
>
>
> Presently if an object is created using BinaryObjectBuilder then several
> BinarySchemes can be generated for the same set of fields in case when fields
> are added in a different order.
> This happens because {{LinkedHashMap}} is used underneath. However we should
> rely on order-free structure like {{TreeMap}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)