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

Roman Puchkovskiy updated IGNITE-28301:
---------------------------------------
    Epic Link: IGNITE-15944

> UOS: do not send unneeded class descriptors for Externalizable classes
> ----------------------------------------------------------------------
>
>                 Key: IGNITE-28301
>                 URL: https://issues.apache.org/jira/browse/IGNITE-28301
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Aleksandr Polovtsev
>            Priority: Major
>              Labels: ignite-3
>
>   h2. Summary                                                                 
>                                                                               
>                                  
>                                                                               
>                                                                               
>                                
>   UOS (User Object Serialization) incorrectly sends class descriptors for all 
> declared field types of {{Externalizable}} classes, even though the 
> {{Externalizable}} contract explicitly delegates serialization to 
> {{writeExternal()}}/{{readExternal()}}. Field types are irrelevant to the 
> wire format — only what the implementation explicitly writes matters.         
>         
>                                                                               
>                                                                               
>                                  
>   h2. Problem                                                                 
>                                                                               
>                                
>   When UOS encounters an {{Externalizable}} class, it collects and sends 
> descriptors for all its field types, even if those fields are never written 
> to the stream via {{writeExternal()}}. This is incorrect because:
>                                                                               
>                                                                               
>                                  
>   * {{Externalizable}} classes are fully responsible for their own 
> serialization format                                                          
>                                             
>   * Field type descriptors add unnecessary overhead to the wire protocol
>   * Sending descriptors for field types that are not part of the serialized 
> form creates a hard dependency on those types being present on the receiving 
> node, even if they are never actually transmitted                             
>                                                                               
>                                                             
>    
>   h2. Example                                                                 
>                                                                               
>                                  
>                                                                               
>                                                                               
>                                
>   {{io.scalecube.cluster.Member}} implements {{Externalizable}}. Its 
> {{writeExternal()}} writes the address as a plain UTF string — not as a Java 
> object. However, UOS sends a descriptor for the field's declared type 
> ({{io.scalecube.net.Address}}) anyway.                                        
>                                                                               
>            
>                                                                               
>                                                                               
>                                
>   h2. Expected Behavior
>   UOS should not send class descriptors for field types of {{Externalizable}} 
> classes. Descriptor collection for such classes should be limited to types 
> that are explicitly written as objects in {{writeExternal()}}, not inferred 
> from field declarations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to