You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Roman Puchkovskiy (Jira)" <ji...@apache.org> on 2024/10/28 17:45:00 UTC
[jira] [Resolved] (IGNITE-23135) Do not use ByteUtils.toBytes() to store persistent data
[ https://issues.apache.org/jira/browse/IGNITE-23135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Roman Puchkovskiy resolved IGNITE-23135.
----------------------------------------
Resolution: Fixed
Implemented in split-out issues
> 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
> Assignee: Roman Puchkovskiy
> Priority: Major
> Labels: ignite-3, important
> Fix For: 3.0
>
>
> 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)
> # Define 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)