apache / fury

A blazingly fast multi-language serialization framework powered by JIT and zero-copy.
https://fury.apache.org/
Apache License 2.0
2.77k stars 194 forks source link

Fury 0.5.1 is not backward compatible with 0.5.0 #1654

Open wkuranowski opened 1 month ago

wkuranowski commented 1 month ago

Search before asking

Version

Fury 0.5.1 Java 22

Component(s)

Java

Minimal reproduce step

I am unable to deserialize objects from Fury 0.5.0.

example bytes which works fine with 0.5.0: byte[] bytes0_5_0 = new byte[] {2, -1, -80, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, -3};

In Fury 0.5.1 I get an exception:

java.lang.NullPointerException: Cannot read field "serializer" because "classInfo" is null
        at org.apache.fury.resolver.ClassResolver.getOrUpdateClassInfo(ClassResolver.java:1129) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.resolver.ClassResolver.readClassInfo(ClassResolver.java:1563) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.Fury.readRef(Fury.java:825) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.serializer.collection.GuavaCollectionSerializers$ImmutableSortedSetSerializer.newCollection(GuavaCollectionSerializers.java:196) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.serializer.collection.CollectionSerializer.read(CollectionSerializer.java:50) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.serializer.collection.CollectionSerializer.read(CollectionSerializer.java:27) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.Fury.readDataInternal(Fury.java:923) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.Fury.readRef(Fury.java:825) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.Fury.deserialize(Fury.java:760) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.Fury.deserialize(Fury.java:682) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.pool.ThreadPoolFury.lambda$deserialize$9(ThreadPoolFury.java:124) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.pool.ThreadPoolFury.execute(ThreadPoolFury.java:73) ~[fury-core-0.5.1.jar!/:0.5.1]
        at org.apache.fury.pool.ThreadPoolFury.deserialize(ThreadPoolFury.java:124) ~[fury-core-0.5.1.jar!/:0.5.1]

What did you expect to see?

Backward compatibility with 0.5.x

What did you see instead?

Fury 0.5.1 produces similar bytes, but with one difference: byte[] bytes0_5_1 = new byte[] {2, -1, **-68**, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, -3};

Anything Else?

No response

Are you willing to submit a PR?

chaokunyang commented 1 month ago

Hi @wkuranowski , thanks for reporting this issue. Currently fury do not provide binary compatibility. We will provide such compatibility but it may wait for some versions

wkuranowski commented 1 month ago

@chaokunyang https://github.com/apache/incubator-fury?tab=readme-ov-file#binary-compatibility

binary compatibility is not guaranteed between Fury major releases for now. However, it is guaranteed between minor versions.