Sub topic 11
Execute and Record the Rollback
Assume you understand model deployment, service monitoring, version control, and API-based services. This chapter focuses on carrying out a planned rollback and leaving an audit trail that another engineer can understand.
A rollback changes production from the current release to a known-good release. Treat it as a controlled production change, not as an informal file replacement. Record what changed, who approved it, which artifact was used, and what the system looked like afterward.
Prepare the change
Before changing traffic, confirm:
- The incident or alert that triggered the rollback.
- The target model version and its immutable artifact digest.
- Approval from the person or process required by your change policy.
- Compatibility between the target model, serving code, input schema, and dependencies.
- A way to restore the current version if the rollback fails.
- Dashboards and alerts for error rate, latency, prediction quality, and business effects.
Select the artifact by version and digest, not by a mutable label such as latest. A version identifies a release. A digest identifies the exact bytes used by that release.
Use a change record similar to this:
change_id: "chg-2026-03-15-0042"
reason: "Error rate exceeded the rollback threshold"
current_version: "2026.03.15"
target_version: "2026.03.08"
expected_artifact_sha256: "sha256:bbb"
approved_by: "on-call-ml-platform"
traffic_plan:
- percent: 10
hold_minutes: 10
- percent: 100
validation:
max_error_rate: 0.03
max_p95_latency_ms: 250
status: "approved"Store this record in the same change-management system as the deployment event. Do not put credentials, customer data, or raw request payloads in it.
Execute in controlled stages
First, verify that the target artifact's digest matches the digest in the change record. Then deploy the target version without sending it all production traffic. The exact command depends on your platform, but the operation should produce an event containing the release, artifact digest, operator, and timestamp.
Move a small percentage of traffic to the target. During the hold period, check both technical and model signals:
- HTTP errors and timeouts
- CPU, memory, and accelerator use
- p95 or p99 latency
- Prediction distributions and confidence scores
- Data quality and drift indicators
- Business outcomes or downstream failures
If the checks pass, move the remaining traffic. If they fail, stop the rollout and restore the safer state. A successful deployment command does not prove that the model behaves correctly.
Record evidence and close the change
Update the record during the operation, not from memory afterward. Include:
- Start and completion timestamps
- The old and new versions
- Artifact digests
- Traffic percentages and hold times
- Commands, deployment IDs, or links to platform events
- Validation measurements before and after the change
- Operator, approver, and final status
- Any alerts, failed checks, or manual decisions
After full traffic moves, observe long enough to cover normal request patterns. Compare the target release with the baseline. Confirm that downstream jobs, cached outputs, and client contracts still work. Mark the change complete only after the acceptance checks pass.
Exercise
During a rollback, the target model has lower error rates but causes a schema error in a downstream service. What should you do?
Show answer
Stop or reverse the traffic change, record the schema failure, and investigate compatibility before retrying. Lower model error rates do not make a broken end-to-end service acceptable.