[ https://issues.apache.org/jira/browse/IGNITE-23135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Tupitsyn updated IGNITE-23135: ------------------------------------ Labels: ignite-3 important (was: ignite-3) > Do not use ByteUtils.toBytes() to store persistent data > ------------------------------------------------------- > > Key: IGNITE-23135 > URL: https://issues.apache.org/jira/browse/IGNITE-23135 > Project: Ignite > Issue Type: Improvement > Reporter: Roman Puchkovskiy > Priority: Major > Labels: ignite-3, important > > Currently, we use ByteUtils#toBytes() to serialize objects that we store to > Vault, Metastorage, other storages (like CMG). This uses Java Serialization. > The problem here is that, as soon as an object is serialized in this way (and > persisted), we cannot rename the corresponding class (or do other > refactorings that would change its structure) without breaking > deserialization. Java Serialization allows to solve this (by using > writeObject/readObject and so on), but the danger here is that we can just > miss that some class serialization has to be modified accordingly. So > implicitness is the main evil here. > It is suggested to introduce an explicit mechanism to serialize objects. We > could implement something like IgniteDataTransferObject from Apache Ignite 2, > but with a couple of modifications: > # Don't use Java Serialization under the hood, so don't use Externalizable; > instead introduce another interface (like ExplicitExternalizable) which would > work with DataInput/DataOutput instead of ObjectInput/ObjectOutput. This will > allow to avoid using writeObject() (such possibility would defeat the purpose > of the explicit serialization mechanism) > # Fix the binary format (disallow swapping DataInput/DataOutput > implementations as it's done in AI2 to make sure the binary format is always > the same) > # Encode ints/longs as varints -- This message was sent by Atlassian Jira (v8.20.10#820010)