CI/CD / Integrity, coordination, and improvement / Lesson 21
Multi-service compatibility and cutover
Plan mixed-version service changes with an explicit compatibility matrix and recovery boundary.
On this page
Lesson goals
- Identify versions that can coexist during a rolling release.
- Test forward and rollback paths across producer and consumer boundaries.
Model coexistence before release
A distributed release rarely changes every producer and consumer at the same instant. List the versions that can coexist, the message or API contract they share and the data state each expects. A successful build of each service alone does not prove a mixed deployment is compatible. Define the rollout order and who can stop the release before any production change.
Record a known combination
The first synthetic matrix entry says producer v1 and consumer v1 both understand a field named status. It is an asserted test expectation, not proof of a deployed system or a universal compatibility rule. Record the exact schema and behavior behind each matrix cell, including missing fields and rejected versions, and keep the candidate artifact identities with the test evidence.
{"producer":"v1","consumer":"v1","event_field":"status","compatible":true}
The fixture describes a known synthetic combination without executing services.
Test the overlap combination
The second entry asserts that producer v2 retains status for consumer v1 during rollout. In an isolated integration test, send representative old and new messages and verify the old consumerโs actual behavior. Also test v1 producer with v2 consumer if that combination can occur. Mark an untested or incompatible cell explicitly; a matrix is a plan until evidence supports it.
{"producer":"v2","consumer":"v1","event_field":"status","compatible":true}
The new producer keeps the field in this fixture; compatibility still requires an actual test.
Coordinate state and rollback
A rollback can return application code to an earlier version while messages or database changes remain. Determine which old versions can read the resulting state and whether external effects need reconciliation. Use an additive, compatible transition where appropriate, migrate bounded data and remove old fields only after dependent consumers have moved. The exact migration and transaction behavior depends on the platform.
Rehearse the cutover
In a disposable environment, deploy the old pair, introduce the new producer and consumer in the planned order, and inspect contract tests and business outcomes at each stage. Interrupt the rollout and exercise the documented rollback with synthetic data. Record service versions, artifact identities, schema state and observed results. A healthy process or completed deployment alone does not prove that every consumer interpreted events correctly.
Common errors and fixes
An old consumer fails when a new producer removes a required field.
- Why it happens
- The mixed-version interval was not tested.
- How to fix it
- Restore a compatible contract and reconcile failed messages.
- Prevent it next time
- Test every reachable matrix combination.
Rollback code cannot read newly migrated data.
- Why it happens
- Application and data compatibility were reviewed separately.
- How to fix it
- Use the documented forward recovery or compatible data plan.
- Prevent it next time
- Rehearse rollback with representative migrated data.
A green service health check hides rejected events.
- Why it happens
- Only process availability was observed.
- How to fix it
- Inspect contract failures and business completion.
- Prevent it next time
- Monitor service and business outcomes together.
2 practice exercises
1. Why test producer v2 with consumer v1 during a rolling rollout?
Show worked solution
The producer can update before every consumer. That mixed combination may receive real messages, so it needs an explicit contract and test evidence before release.
2. Can reverting the producer alone undo messages already consumed?
Show worked solution
No. Existing messages and downstream effects remain subject to their own contracts. Reconcile what was published and processed, then apply the approved data or forward-recovery procedure.
Key takeaways
- Enumerate reachable mixed-version combinations before cutover.
- Rehearse rollback with real contract and data boundaries in an isolated environment.