← All solutions

The rollback that made it worse

The release changed durable queue messages as well as executable code. The canary used an empty queue and tested only newly produced schema-2 messages. Production contained schema-1 messages from before the rollout. Worker 2.0 parked those messages. Rolling both images back restored schema-1 processing, but schema-2 messages remained in the queue. Worker 1.8 acknowledged them without creating shipments. The broker dashboard recovered while the business outcome got worse.

Prove the failure

Run worker 2.0 against the canary: every order gets fulfilled. Run it against the production snapshot: the older messages are held. Run worker 1.8 against production: the newer messages get acknowledged without fulfillment. The inputs, not just the executable image, must be included in a rollback plan.

Repair the worker

Handle both message layouts. Preserve the operation key originally allocated to the order, and retain unfamiliar inputs:

def handle(job):
    if job.get("schema") == 1:
        order_id = job["order_id"]
        key = job["operation_key"]
    elif job.get("schema") == 2:
        order_id = job["payload"]["order"]["id"]
        key = job["payload"]["operation"]["key"]
    else:
        return {"action": "hold"}
    return {"action": "dispatch", "order_id": order_id, "operation_key": key}

Malformed known envelopes raise an adapter error and are parked by the harness. Explicit defensive checks are also valid. Test the draft against production plus redelivery, then deploy. Deployment validates both layouts, operation identity, retries with new delivery IDs, and retention of unknown or malformed work.

Recover the incident

Process the existing queue with the deployed handler. It fulfills six more orders. Four orders still have no shipment: their old deliveries were already acknowledged. Replay receipts 03–06, then process the queue again. All twelve paid orders now have one shipment.

Replaying all valid receipts also works with a correct handler: the durable operation ledger suppresses work already committed. A delivery ID is unsuitable as an operation key because a replay changes it.

Retrying held work must keep future or malformed inputs available for inspection. A retained message is not a missing shipment for a valid paid order.

Select Verify recovery. Completion checks actual shipment state and the deployed handler's behavior. Green process health, empty queues, and successful acknowledgments cannot substitute for reconciliation.