...
- Communication protocol is peer-to-peer protocol: every message is sent between one node-sender and one node-receiver.
- Communication protocol is an internal protocol used for system messages exchange between Ignite nodes:
- There is a limited amount of peers, and all peers are aware of versions of each other.
- All peers are aware of all possible messages and their schemas.
- At most time peers are of same version. In short period of time (during RU) messags schemas might differ, but not much (few messages might differ with few fields only).
- It is proposed to provide compatibility between versions that differ by 1 minor version, for example between 2.20.X and 2.19.X (but not between 2.20.X and 2.18.X).
- Messages can be pretty big, contains cache entries (putAll, historic rebalance).
- Code changes should be minimal.
- Users applications deployed on cluster (services, etc) must support compatibility by itself.
Current implementation of Communication protocol:
- All peers hold predefined messages schemas.
- Messages follow schema in strict way - no fields are skipped and order of fields is guaranteed.
- Peers send messages as byte stream serializing fields one by one, no delimiters are used between fields and messages.
Proposed changes
Message DTO
...
Message#writeTo, Message#readFrom Ser/des logic is depends on a remote peer version IgniteProductVersion.- Code of ser/des is
Message#writeTo, Message#readFrom is auto-generated and stored separately from message Message DTO classes. - Add
@Since, @Until annotations for Message classes and fields. - Marshalling must be done within
Message#writeTo with specifying remote version to marshaller.byte[] fields in Message must be forbidden.
Marshaller
Marshaller#marshal, Marshaller#unmarshal is depends on remote IgniteProductVersion.
Version check
- Ignite CI must notify for IF-clauses with condition based on IgniteVersion older than
(curVer - 1). - Ignite CI must forbid merging code changes if Message DTO changed without corresponding @Since, @Until annotations.
- Ignite CI must forbid code changes if Message DTO contains byte[] fields.
Nice to have (for later research)
...