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

Denis Mekhanikov commented on IGNITE-12479:
-------------------------------------------

A patch is ready. [~sergey-chugunov] could you help with a review?

PR: https://github.com/apache/ignite/pull/7178

> All binary types are registered twice
> -------------------------------------
>
>                 Key: IGNITE-12479
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12479
>             Project: Ignite
>          Issue Type: Bug
>          Components: binary
>            Reporter: Denis Mekhanikov
>            Assignee: Denis Mekhanikov
>            Priority: Major
>             Fix For: 2.8
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When a POJO is put into a cache, its binary type is registered twice during 
> marshalling.
> Example:
> {code:java}
> public class MetadataRegistrationExample {
>     public static void main(String[] args) {
>         Ignite ignite = Ignition.start("config/ignite.xml");
>         Person p = new Person("Denis");
>         ignite.getOrCreateCache("cache").put(1, p);
>     }
>     static class Person {
>         private String name;
>         public Person(String name) {
>             this.name = name;
>         }
>     }
> }
> {code}
>  
> Here is the generated debug log from the package
> {noformat}
> [23:31:14,020][DEBUG][main][CacheObjectBinaryProcessorImpl] Requesting 
> metadata update [typeId=-1210012928, 
> typeName=binary.NestedObjectMarshallingExample$Person, changedSchemas=[], 
> holder=null, fut=MetadataUpdateResultFuture [key=SyncKey [typeId=-1210012928, 
> ver=0]]]
> [23:31:14,023][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Received MetadataUpdateProposedListener [typeId=-1210012928, 
> typeName=binary.NestedObjectMarshallingExample$Person, pendingVer=0, 
> acceptedVer=0, schemasCnt=0]
> [23:31:14,024][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Versions are stamped on coordinator [typeId=-1210012928, changedSchemas=[], 
> pendingVer=1, acceptedVer=0]
> [23:31:14,024][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Updated metadata on originating node: [typeId=-1210012928, pendingVer=1, 
> acceptedVer=0]
> [23:31:14,025][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Received MetadataUpdateAcceptedMessage MetadataUpdateAcceptedMessage 
> [id=599e0a86c61-183a790b-7038-4dd5-b99d-89f1483e3635, typeId=-1210012928, 
> acceptedVer=1, duplicated=false]
> [23:31:14,025][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Completing future MetadataUpdateResultFuture [key=SyncKey 
> [typeId=-1210012928, ver=1]] for [typeId=-1210012928, pendingVer=1, 
> acceptedVer=1]
> [23:31:14,026][DEBUG][main][CacheObjectBinaryProcessorImpl] Completed 
> metadata update [typeId=-1210012928, 
> typeName=binary.NestedObjectMarshallingExample$Person, waitTime=4ms, 
> fut=MetadataUpdateResultFuture [key=SyncKey [typeId=-1210012928, ver=1]], 
> tx=null]
> [23:31:14,027][DEBUG][main][CacheObjectBinaryProcessorImpl] Requesting 
> metadata update [typeId=-1210012928, 
> typeName=binary.NestedObjectMarshallingExample$Person, 
> changedSchemas=[1975878747], holder=[typeId=-1210012928, pendingVer=1, 
> acceptedVer=1], fut=MetadataUpdateResultFuture [key=SyncKey 
> [typeId=-1210012928, ver=0]]]
> [23:31:14,027][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Received MetadataUpdateProposedListener [typeId=-1210012928, 
> typeName=binary.NestedObjectMarshallingExample$Person, pendingVer=0, 
> acceptedVer=0, schemasCnt=1]
> [23:31:14,028][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Versions are stamped on coordinator [typeId=-1210012928, 
> changedSchemas=[1975878747], pendingVer=2, acceptedVer=1]
> [23:31:14,028][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Updated metadata on originating node: [typeId=-1210012928, pendingVer=2, 
> acceptedVer=1]
> [23:31:14,028][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Received MetadataUpdateAcceptedMessage MetadataUpdateAcceptedMessage 
> [id=d99e0a86c61-183a790b-7038-4dd5-b99d-89f1483e3635, typeId=-1210012928, 
> acceptedVer=2, duplicated=false]
> [23:31:14,028][DEBUG][disco-notifier-worker-#41][CacheObjectBinaryProcessorImpl]
>  Completing future MetadataUpdateResultFuture [key=SyncKey 
> [typeId=-1210012928, ver=2]] for [typeId=-1210012928, pendingVer=2, 
> acceptedVer=2]
> [23:31:14,029][DEBUG][main][CacheObjectBinaryProcessorImpl] Completed 
> metadata update [typeId=-1210012928, 
> typeName=binary.NestedObjectMarshallingExample$Person, waitTime=1ms, 
> fut=MetadataUpdateResultFuture [key=SyncKey [typeId=-1210012928, ver=2]], 
> tx=null]
> {noformat}
> You can see, that a type is registered twice. First it's registered without 
> any fields, and only the second time the type is registered properly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to