Git, CI/CD & GitOpsLX · Forward Fix versus RollbackDataIntegrity
Rollback and data integrity — when rollback cannot be undone and the cascading data effects
What you'll learn
- Recognise the cascading data effects that make a rollback operationally destructive even when it is technically possible
- Map the cascade across replicas, caches, queues, and downstream consumers
- Apply the discipline of accepting the forward-fix even when the rollback is faster
- Identify the change patterns that produce cascades and pre-stage the forward-fix for them
Prerequisites
Verified against Git 2.55.x teaching target; 2.40+ minimum · GitHub Actions continuous service; Aug 2026 documentation baseline · Argo CD v3.5.x teaching target; v3.0+ minimum · Flux v2.9.x · Sigstore Cosign v3.1.x · SLSA v1.2 · OCI Distribution Specification v1.1 · Git LFS v3.7.1 · Kubernetes (cross-course target) 1.36.x
A change can be rollback-able at the workload level and still be operationally destructive at the data level. The Deployment rolls back; the data the new ReplicaSet wrote is left behind. The replicas that already processed the new behaviour keep their state; the cache that warmed from the new responses holds the new values; the queue holds the new message format.
The cascade model
A rollback produces cascading data effects when the change’s behaviour has propagated beyond the workload that received the change:
flowchart LR
A["Workload change"] --> B["Replica state"]
B --> C["Cache layer"]
C --> D["Queue / stream"]
D --> E["Downstream consumer"]
E --> F["Cascading rollback damage"]
Each layer the change touched becomes a layer the rollback does not reconcile:
- Replica state. Each replica processed the change’s new behaviour. In-memory state (sessions, counters, deduplication windows) reflects the new behaviour. Rolling back the workload does not roll back the in-memory state.
- Cache layer. The cache warmed from the new responses. Rolling back does not invalidate the cache.
- Queue / stream. The queue accepted messages in the new format. Rolling back does not drain the queue.
- Downstream consumer. The downstream service wrote its own state based on the new behaviour. Rolling back does not roll back that state.
The cascade is asymmetric. The change’s effects propagated forward; the rollback’s effects do not propagate backward.
Change patterns that produce cascades
- Stateful service changes. A service that holds session state in memory produces a cascade: the new sessions are lost, in-progress transactions abandoned, deduplication windows reset.
- Cache-warming changes. A service that warms a shared cache (CDN, Redis) produces a cascade: the cache holds entries the old code did not produce.
- Message-format changes. A service that publishes in a new format produces a cascade: the queue holds messages the old consumer cannot parse.
- Idempotency-key changes. A service that uses a different key algorithm produces a cascade: the downstream sees the same logical operation with two different keys and processes it twice.
Recognising the cascade
The cascade is recognisable in the change review:
- Does the service hold session state in memory? If yes, the rollback abandons the sessions. Forward-fix must include a session-migration step.
- Does the service warm a shared cache? If yes, the rollback leaves the cache warm. Forward-fix must include a cache-invalidation step.
- Does the service publish messages in a new format? If yes, the queue holds new messages. Forward-fix must include a queue-drain step or a dual-format consumer.
- Does the service use an idempotency key? If yes, the key algorithm change is observable downstream. Forward-fix must include a key-mapping step.
A change that answers yes to any of the four questions produces a cascade. The classification is “forward-fix by default”.
The forward-fix acceptance
- Document the cascade in the deploy annotation. The on-call engineer sees the cascade warning and knows the forward-fix is the path.
- Pre-stage the forward-fix. The compensating change is written, tested, and ready to merge.
- Set the MTTR budget for the cascade case. The budget is the apply-and-verify time (7-12 min), not the write-and-test time.
- Track the cascade in the incident record. Every cascade case builds the evidence that the cascade is a real cost.
Production discipline
- Recognise the cascade in the change review. The four questions are part of the reviewer’s checklist.
- Document the cascade in the deploy annotation.
- Pre-stage the forward-fix for cascading changes.
- Accept the forward-fix over the faster rollback. The acceptance is a deliberate decision documented before the change ships.
- Track every cascade case in the incident record.
Cross-course references
- This course, Part LIX-06 covers the change-level classification.
- This course, Part LVIII-04 covers routing that isolates the cascade.
- Linux for Production Sysadmins - Part XXXI covers the metrics that detect the cascade.
Quiz
Knowledge check · 4 questions
Q1. A team deploys a change to a stateful service that holds session state in memory. The change is rollback-safe at the workload level. Within minutes, the application fails for users with active sessions. What is the correct response?
Q2. A change that is rollback-safe at the workload level is not always operationally safe to roll back, because the workload's previous version is the system's previous good state.
Q3. Name the four layers of the cascade that a rollback does not reconcile, and identify the change-review question that detects each layer.
Q4. Diagnose why a rollback of a stateful service appeared to succeed but the application remained unhealthy, and identify the cascade that produced the failure.
A team deploys a change to a payment service that adds idempotency-key support. The change introduces a new key algorithm that hashes the request body. Within minutes, the downstream ledger service reports duplicate transactions: the new key algorithm produces different keys for the same logical operation, and the ledger's deduplication fails. The on-call engineer rolls back the payment service via kubectl rollout undo. The rollback completes; the previous ReplicaSet is up. The duplicate transactions continue. The ledger has already processed the duplicates; the rollback did not un-process them.
Passing score: 75%. Answers are checked in this browser.