Nikolay Izhikov created IGNITE-29150:
----------------------------------------
Summary: 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
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)