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

Nikolay Izhikov commented on IGNITE-29150:
------------------------------------------

Results of the test run: old node built from commit 3c6463f1ec2 (IGNITE-28940, 
2026-08-14, installed as 2.19.0-base) vs the current master (6801c7d3c62).

323 messages checked, 13 findings in 7 messages:
{noformat}
org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode: the same fields 
are serialized to different bytes [expectedLen=612, actualLen=663, 
firstDiffIdx=612]
org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode: failed to 
deserialize with the current version: java.lang.IllegalStateException: Message 
is not fully read [bytes=612]
org.apache.ignite.spi.discovery.SerializableDataBagItemWrapper: absent in the 
current version
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHandshakeRequest: the 
same fields are serialized to different bytes [expectedLen=709, actualLen=691, 
firstDiffIdx=641]
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHandshakeRequest: 
failed to deserialize with the current version: class 
org.apache.ignite.internal.managers.communication.UnknownMessageException: 
Invalid message type: 8451
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHandshakeResponse: the 
same fields are serialized to different bytes [expectedLen=853, actualLen=836, 
firstDiffIdx=785]
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHandshakeResponse: 
failed to deserialize with the current version: class 
org.apache.ignite.internal.managers.communication.UnknownMessageException: 
Invalid message type: 8451
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryJoinRequestMessage: 
the same fields are serialized to different bytes [expectedLen=2026, 
actualLen=2039, firstDiffIdx=1230]
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryJoinRequestMessage: 
failed to deserialize with the current version: java.lang.ClassCastException: 
class org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacket cannot 
be cast to class 
org.apache.ignite.internal.processors.rollingupgrade.feature.IgniteNodeFeatureSet
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddedMessage: the 
same fields are serialized to different bytes [expectedLen=6241, 
actualLen=6306, firstDiffIdx=1227]
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddedMessage: 
failed to deserialize with the current version: java.lang.ClassCastException: 
class org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacket cannot 
be cast to class 
org.apache.ignite.internal.processors.rollingupgrade.feature.IgniteNodeFeatureSet
org.apache.ignite.internal.processors.rollingupgrade.RollingUpgradeClusterData: 
the same fields are serialized to different bytes [expectedLen=155, 
actualLen=121, firstDiffIdx=20]
org.apache.ignite.internal.processors.rollingupgrade.RollingUpgradeClusterData: 
failed to deserialize with the current version: class 
org.apache.ignite.internal.managers.communication.UnknownMessageException: 
Invalid message type: 8451
{noformat}

All of them correspond to changes made after the commit:
* {{SerializableDataBagItemWrapper}} was removed by IGNITE-28988.
* {{TcpDiscoveryNode}} got the node feature set (IGNITE-28990): the current 
code writes extra bytes at the end and stops short reading the old bytes; 
{{TcpDiscoveryJoinRequestMessage}} and {{TcpDiscoveryNodeAddedMessage}} differ 
through the embedded node and fail to read the data packet after the inserted 
field.
* {{TcpDiscoveryHandshakeRequest}}, {{TcpDiscoveryHandshakeResponse}} and 
{{RollingUpgradeClusterData}} embed the feature set messages whose direct type 
8451 does not exist in the current registry.

With an old node built from a current development snapshot the test passes: 323 
messages, 0 errors.


> Compatibility test of the wire format of communication and discovery messages
> -----------------------------------------------------------------------------
>
>                 Key: IGNITE-29150
>                 URL: https://issues.apache.org/jira/browse/IGNITE-29150
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Nikolay Izhikov
>            Priority: Major
>              Labels: iep-132
>         Attachments: IGNITE-29150.patch
>
>
> h3. Motivation
> Rolling Upgrade (IEP-132) requires the wire format of the communication and 
> discovery messages to stay compatible between Ignite releases. Today nothing 
> checks it automatically: a changed @Order, a renamed or reordered field, or a 
> renumbered direct type is noticed only when mixed-version nodes fail to talk 
> to each other.
> h3. Proposal
> Add a compatibility test that compares the byte representation of every 
> message between the latest released version and the current code:
> # A node of the previous version is started in a separate JVM (the standard 
> compatibility framework).
> # A compute task executed on it via the thin client takes every message 
> registered in its message factories, fills the fields via reflection with 
> values derived from the field names, serializes the message the way the node 
> does it (writer of the node message formatter, {{MessageSerialization}} / 
> {{MessageSerializer#writeTo}} on the old versions) and returns {{Map<class 
> name, byte[]>}}.
> # For every message the current code checks that the message filled the same 
> way is serialized to the same bytes, and that the message deserialized from 
> the old bytes is serialized back to the same bytes.
> The messages are taken from the message factories and filled via reflection, 
> so neither a new message nor a new field of an existing message requires a 
> test change. Abstract field types are resolved among the message classes 
> known to the old node, so both versions fill the messages identically.
> The checked version defaults to the latest {{IgniteReleasedVersion}} and can 
> be overridden with {{-DIGNITE_MESSAGES_COMPATIBILITY_VERSION=<version>}}, 
> which allows to compare any locally built version (for example, {{./mvnw 
> install -pl :ignite-core -am -DskipTests -Drevision=2.19.0-base}} from a 
> commit of interest).
> h3. Notes
> * Against 2.18.0 every message fails because IGNITE-28221 renumbered all 
> direct types. The first release carrying the new ids will be the first usable 
> baseline.
> * Supports the old versions both with the serialization context (current API) 
> and without it (2.18.0 and the development versions before the context), 
> invoking {{MessageSerializer#writeTo(Message, MessageWriter)}} via reflection 
> for the latter.



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

Reply via email to