Sub topic 9
Prepare a Reversible Rollback Plan
Prerequisites and goal
Assume you understand model deployment, production monitoring, version control, and APIs. A rollback plan is a written procedure for returning a service to a known-good state after a model release causes harm.
A reversible plan answers four questions before the incident:
- Which release will we restore?
- Which model artifact, code, configuration, and dependencies belong to that release?
- How will we move traffic safely?
- How will we prove that the rollback worked?
The plan must also describe how to stop the rollback or move forward if validation fails.
Define the rollback target
Choose a known-good release, not merely an older version number. Record the model version, artifact digest, application revision, feature definitions, dependency lockfile, and configuration. An artifact digest is a cryptographic identifier that confirms the exact file being deployed.
The target release should have evidence of successful production behavior. Useful evidence includes prediction quality, error rate, latency, resource use, and downstream business metrics.
| Plan item | Example |
|---|---|
| Target model | `2026.03.08` |
| Artifact identity | `sha256:bbb` |
| Application revision | `app-4f21c7` |
| Validation owner | On-call ML engineer |
| Abort condition | Error rate above `3%` |
Check compatibility before execution. The older model may require a different feature schema, tokenizer, runtime, or output format. Confirm that the current service can load it and that consumers can handle its predictions. If a schema changed, include the compatible application revision or a safe migration step in the rollback unit.
Make the procedure reversible
Write the rollback as a sequence of checkpoints:
- Freeze unrelated deployments and record the incident ticket.
- Snapshot current versions, configuration, traffic weights, and live health metrics.
- Verify the target artifact digest and provenance.
- Deploy the target without sending production traffic.
- Run smoke tests and compatibility checks.
- Send a small percentage of traffic to the target.
- Compare target metrics with the current release and the rollback thresholds.
- Increase traffic only after an explicit checkpoint.
- Keep the previous release available until post-rollback validation completes.
Each checkpoint needs an owner, an expected result, and an action if the result is unexpected. This prevents an operator from continuing automatically after a failed test.
Record the change and validation rules
Use an auditable change record. Include the incident identifier, timestamps, operator, approvals, commands or deployment links, version identities, traffic changes, metric snapshots, and final decision.
Express thresholds before the rollback starts. For example, stop if error rate exceeds 3%, p95 latency exceeds 250 ms, or prediction quality falls below its agreed limit. Also define how long each traffic step must remain stable.
rollback:
target_version: "2026.03.08"
expected_artifact_sha256: "sha256:bbb"
traffic_steps:
- percent: 10
hold_minutes: 10
- percent: 100
validation:
max_error_rate: 0.03
max_p95_latency_ms: 250The plan is complete when another on-call engineer can execute it without guessing, stop safely at every checkpoint, and return to the prior state if validation fails.
Exercise
Why should a rollback plan record an artifact digest instead of only a model version?
Show answer
A version label can point to a changed or incorrect file. The digest identifies the exact artifact that was verified and approved.