| ID | IEP-132 |
| Author | |
| Sponsor | |
| Created | |
| Status | | Status |
|---|
| colour | Blue |
|---|
| title | IN PROGRESS |
|---|
|
|
Motivation
For now, Ignite cluster can be updated upgraded only by full cluster restart.
Procedure must be the following:
- stop all Stop ALL cluster nodes.
- update Update files on each node.
- start Start nodes one by one.
So, each Each version update is a means cluster temporary unavailability for the end user.
This is extremely inconvenient, especially for the user, especially one users who use Ignite as a primary data storage.
Other systems supports rolling upgrade feature when upgrade made node by node without unavailability period.
After implementing rolling upgrade, Ignite must support the following upgrade procedure:
- Stop one node.
- Upgrade files on the node.
- Start node.
- Repeat steps 1-3 for each node in cluster.
We must add rolling upgrade feature to the Ignite.
Description
Let's see how rolling upgrade implemented in other systems:
Other systems
Many distributed open source systems has rolling upgrade feature, already.
We must study implemented approaches to gain some insights from them.
- Is there rolling upgrade feature?
- How it implemented?
- How it tested?
- When it tested: Each PR? Weekly? Only on release?
- Network message format.
- Serdes implementation.
- How many earlier releases can be upgraded.
Name | Supported | How it implemented? | How it tested? | When it tested? | Network message format | Serdes implementation | How many earlier releases can be upgraded? |
|---|
| Apache Cassandra | Yes (1), (2) | Server-client compatibility works similar to Ignite Thin Client protocol. | Compatibility checked with the special test framework (3) At a first glance, there are no special source code checks to ensure compatibility in day by day coding | On release or by request | POJO | Custom serdes implementation. |
|
| Apache Kafka | Yes (4) | Message formats checked on PR reivew. At a first glance, there are no special source code checks to ensure compatibility in day by day coding. But, all machinery to code compatible implemented in code generation framework (5) | Compatibility checked with the special test framework ducktest (6) | On release or by request. Kafka doesn't provide public resources to run ducktests. Run done by contributors or by confluent employers on private hosts | POJO | Custom serdes implementation. | All |
| Yugabyte | Yes (7) | checked on review (see commit message section "Upgrade/Rollback safety") (8) |
|
| plain objects | Protobuf |
|
| YDB | Yes | Message formats checked on PR rivew - grpc+protobuf helps to maintain compatibility | Compatibility checked with the special test framework (9) | On request. | plain objects | Protobuf |
|
| Cockroach DB | Yes |
|
|
| plain objects | Protobuf |
|
| Hazelcast | Yes (12) |
|
|
|
|
|
|
Description
Rolling Upgrade assumes Rolling Upgrade assume that cluster can consist of Ignite versions nodes of different versions.
So Ignite must provide backward compatibility on network level and ability to work in mixed topology.
Development time checks, tests must be added to provide protection of incorrect patches.
Ignite codebase must be reorganized in a way to clearly distinguish those parts that require compatibility and those who don't.
Let's define clearly, what "backward compatibility" for the network messages means:
- New Ignite server MUST be able to read previous version of message.
- Old Ignite server MUST be able to read new version of message
- Newly added fields MUST be ignored.
- Removed fields MUST have default values. .
Note, there are guide for PDS compatibility, already (11).
Let's list subsystems that must be reworked to provide compatibility:
- communication: Communication messages consists of two parts:
- Message format: message format itself. Communication API should be reworked to force backward compatible messages.
- User data: Message can store user data. User data format must be backward compatible.
- discovery:
- Message format: message format itself. Communication
Discovery API must be reworked to force backward compatible messages.
- binary marshaller:
- Currently, binary marshaller code highly coupled with the other Ignite code.
We must modularize Binary infrastructure (IEP-119 Binary infrastructure modularization10) and provide compatibility guarantees for each part of it.
- features:
- Framework to enable/disable features for mixed version clusters must be developed.
- affinity:
- Affinity function must the same for each online node version.
- management commands
All subsystem that must be compatible:
- PDS
- partition data
- WAL records
- Metadatametadata
- binary meta
- marshaller
- communication messages
- discovery messages
- binary marshaller format
- affinity results.
- Communication SPI
- Discovery SPI
- Binary Marshaller
- Affinity.
- Management APImanagement commands
- argument
- results
- tasks (class names).
- ThinClient Protocol
Compatibility Matrix
| Component | Type | Number of releases |
|---|
| Ignite public API | backward | 1 |
| PDS | backward | all |
| WAL | backward | all |
| Metadata | backward | all |
| Thin Client | full | all |
| Communication SPI | full | 1 |
| Discovery SPI | full | 1 |
| Binary Marshaller | backward | all |
| Management API | backward | 1 |
| Affinity | full | all |
| JDBC | backward | 1 |
| ODBC | backward | 1 |
| Rest | backward | 1 |
| CDC | full | 1 |
Current Ignite codebase
- Is there any primitives, building blocks to provide compatibility?
- Difficulties for day by day coding.
- java serialzation
- anonymous class names based on declaration order
- Compatibility testing.
- explicit tests.
- ability to run tests with random node versions
- New feature implementation, enabling.
- patterns for implementing commons cases: new version of algorithmes, testing against new versions.
- Scope of compatibility:
- Currently any third-party module can register own ports (messages?) and must be able to track compatibility.
Implementation phases
Code
...
Cleanup
- remove
DirectByteBufferStreamImpl V1-V3, keep V4, only.
...
- remove all items from
IgniteFeatures and corresponding checks.
...
- remove all code and checks for GridContinuousProcessor#discoProtoVer
...
- TcpDiscoverySpi#setForceServerMode
...
- All old version of classes - keep only max from V2, V3, etc. versions. StartRequestV2 that belongs to internal communication.
Classes releated to thin client, jdbc, odbc interaction must stay.
...
- StartRequest must be deleted. Rename StartRequestV2 → StartRequest.
...
- CacheMetricsSnapshot must be deleted. Rename CacheMetricsSnapshotV2 → CacheMetricsSnapshot.
...
Additional materials
Many distributed open source systems has rolling upgrade feature, already.
We must study implemented approaches to gain some insights from them.
- Is there rolling upgrade feature?
- How it implemented?
- How it tested?
- When it tested: Each PR? Weekly? Only on release?
- Network message format.
- Serdes implementation.
- How many earlier releases can be upgraded.
Apache Cassandra
...
- remove MessageFactory.
- IgniteDataTransferObject
-
EXCHANGE_PROTOCOL_2_SINCE and related code
-
IgniteProductVersion.fromString - usages
| Jira |
|---|
| server | ASF JIRA |
|---|
| columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
|---|
| columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
|---|
| maximumIssues | 20 |
|---|
| jqlQuery | issue = IGNITE-27674 |
|---|
| serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
|---|
|
BinaryMarshaller modularization
- modularize BinaryMarshaller.
- create small jar for ignite thin client. As a separate module, not part of the core. Optional, helps to see if changes affect resialization.
- provide clear API for binary objects inside ignite-code and other modules. Finish IEP-119. Optional, helps to see if changes affect resialization.
| Jira |
|---|
| server | ASF JIRA |
|---|
| columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
|---|
| columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
|---|
| maximumIssues | 20 |
|---|
| jqlQuery | issue = IGNITE-24780 |
|---|
| serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
|---|
|
Communication SPI Compatibility
- Communication MessageWriter and MessageReader are aware of peers version, and then schema of a message.
- Distinguish serdes generation from POJO
- Guarantee that all messages use new serialization framework. Remove previous framework classes.
- Code checks, see Communication protocol#Codechecks
| Jira |
|---|
| server | ASF JIRA |
|---|
| columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
|---|
| columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
|---|
| maximumIssues | 20 |
|---|
| jqlQuery | issue = IGNITE-25881 |
|---|
| serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
|---|
|
Discovery SPI Compatibility
-
Serdes changes to provide compatibility? (current approach with JDK serialization provides some compatibility (13).
Is it enough for long-term compatibility support? -
Serdes changes to restrict classes that can be sent over SPI. - Guarantee that all messages use new serialization framework. Remove previous framework classes.
- Code checks, see Communication protocol#Codechecks
| Jira |
|---|
| server | ASF JIRA |
|---|
| columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
|---|
| columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
|---|
| maximumIssues | 20 |
|---|
| jqlQuery | issue = IGNITE-25883 |
|---|
| serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
|---|
|
Public API PR validation
- PR checks for
Messages ancestor change with the some warning, labels, etc. that can draw reviewer attention to the possible compatibility issues.
Management API
- Provide ability to change arg, result classes in compatible way.
- Possible approach is to reuse communication serdes framework.
- Other possibility is to migrate on BinaryObject as a arguments and results.
- PR checks for
Messages ancestor change with the some warning, labels, etc. that can draw reviewer attention to the possible compatibility issues.
| Jira |
|---|
| server | ASF JIRA |
|---|
| columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
|---|
| columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
|---|
| maximumIssues | 20 |
|---|
| jqlQuery | issue = IGNITE-27621 |
|---|
| serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
|---|
|
IgniteFeatures
- Write down clear rules to deal with the new features and not compatible enhancements.
- Support, if not, already this rules in IgniteFeatures framework.
| Jira |
|---|
| server | ASF JIRA |
|---|
| columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
|---|
| columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
|---|
| maximumIssues | 20 |
|---|
| jqlQuery | issue = IGNITE-28424 |
|---|
| serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
|---|
|
Compatibility Matrix
- A way to declare one version as incompatible with another.
- A component to enforce a rule that only compatible versions can join one cluster.
- Only nodes with close versions (like 2.17 and 2.18, not 2.17 and 2.19) should be allowed to join cluster.
Testing
- ducktests to check upgrade procedure.
unit tests mode that start some nodes of previous version.
Development process changes
Any change in public API MUST be in the form of IEP.
Any change in public API MUST be voted by two(three?) committers.- Documentation with clear description of development rules for all subsystems required to be compatible.
- Each release should be started with compatibility code removal.
Alternative designs
- subsystem API versions (like in REST API)
- runtime component(IgniteProcessor, IgniteManager) upgrade with the dynamic class loading.
Reference Links
- https://www.datastax.com/learn/whats-new-for-cassandra-4/migrating-cassandra-4x
- https://docs.datastax.com/en/luna-cassandra/guides/upgrade/overview.htmlServer-client compatibility works similar to Ignite Thin Client protocol.
- Compatibility checked with the special test framework - https://github.com/apache/cassandra-dtest/blob/trunk/upgrade_tests/README.md
At a first glance, there are no special source code checks to ensure compatibility in day by day coding. - On release or by request.
- POJO
- Internal serdes.
- ?
Apache Kafka
- Rolling upgrade implemented. Guide - https://kafka.apache.org/documentation/#upgradeMessage formats checked on PR reivew.
- At a first glance, there are no special source code checks to ensure compatibility in day by day coding.
But, all machinery to code compatible implemented in code generation framework - https://github.com/apache/kafka/blob/trunk/clients/src/main/resources/common/message/AlterPartitionResponse.json - Compatibility checked with the special test framework ducktest - https://github.com/apache/kafka/blob/trunk/tests/kafkatest/tests/core/kraft_upgrade_test.py
- On release or by request.
Kafka doesn't provide public resources to run ducktests. Run done by contributors or by confluent employers on private hosts. - POJO
- Internal autogenerated serdes.
- ?
Yugabyte
- Rolling upgrade implemented. Doc - https://docs.yugabyte.com/preview/manage/upgrade-deployment/
- It seems compatibility checked on review (see commit message section "Upgrade/Rollback safety") - https://github.com/yugabyte/yugabyte-db/commit/e9ab17dea0d3b4f1673531c07404a290f9fbd8f2???
- ???
- simple data structures.
- protobuf.
- ?
YDB
- Rolling upgrade implemented.
- Message formats checked on PR rivew - grpc+protobuf helps to maintain compatibility.
- Compatibility checked with the special test framework - https://github.com/ydb-platform/ydb/blob/main/ydb/tests/functional/restarts/
- On request.
- simple data structures
- protobuf
- ?
Cockroach DB
- Rolling upgrade implemented.
- ?
- ?
- ?
- simple data structures.
- protobuf.
- ?
Hazelcast
- Rolling upgrade implemented
- ?
- ?
- ?
- ?
- ?
- ?
Alternative designs
...
- IEP-119 Binary infrastructure modularization
- PDS Compatibility Guide (WIP)
- https://hazelcast.com/products/rolling-upgrade/
- https://docs.oracle.com/en/java/javase/17/docs/specs/serialization/version.html#compatible-java-type-evolution
Tickets
| Jira |
|---|
| server | ASF JIRA |
|---|
| columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
|---|
| columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
|---|
| maximumIssues | 20 |
|---|
| jqlQuery | labels = IEP-132 and type != Epic |
|---|
| serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
|---|
|