M7-S2 — Incident drill
Section titled “M7-S2 — Incident drill”| Module | M7 — Incidents |
| After this session you can | Restore service in three common incidents on a live release, handle a dead-letter queue safely, and record each incident so the next operator learns from it. |
| Time | Facilitated: 54 min · On your own: 53 min |
| Before you start | M7-S1: the method, the catalogue and the safety rules. The release healthy; the core-rest transport back on. |
| Go deeper | Runbooks: replay the message bus · Maintenance operations: RabbitMQ |
◆ Orientation (1 min) — Practise where it is safe
Section titled “◆ Orientation (1 min) — Practise where it is safe”The first time you follow a runbook should not be at three in the morning on Northwind’s production. Here you cause three incidents on your own lab, each from a short “injection” card, and then work them from the symptom, as if someone else had caused them. Keep the clock running: each incident has a time limit, as a real one would.
⛏ Lab (39 min) — Three incidents
Section titled “⛏ Lab (39 min) — Three incidents”Goal. Each incident diagnosed, recovered, verified and written up within its time limit.
How the drill works. With a facilitator, the facilitator injects each incident while you are away from the keyboard, and you work it alone or in a pair. On your own, run the injection, then close it, start a timer, and work from the symptom only: do not look at the model answer until the incident note is written.
Keep an incident note for each, in inventory.md:
Incident <n> | started <time> | resolved <time>Symptom:Layer and store:What I did (with times):Verified by:What would have caught it sooner:Before you start. Two terminals; the Mailpit and RabbitMQ management port-forwards available.
Incident 1: “Search has not updated since lunch” (12 minutes)
Section titled “Incident 1: “Search has not updated since lunch” (12 minutes)”Injection: kubectl -n northwind scale deploy/nw-osos-indexing --replicas=0
- In the portal, change Drill Marker’s job title twice, so there is work to index.
- Work the incident from the symptom. Useful evidence: the indexing queue’s consumers
(
rabbitmqctl list_queues -p nw name consumers messages), the pods, andosos_queue_depth. - Restore the release to its values, not by hand:
helm upgrade nw ./osos -n northwind $values --wait --timeout 10m. - Verify: the indexing queue has a consumer again and its messages fall to
0.
Incident 2: “Strange messages in a dead-letter queue” (15 minutes)
Section titled “Incident 2: “Strange messages in a dead-letter queue” (15 minutes)”Injection: place an unreadable message on the timeline application’s dead-letter queue through RabbitMQ’s management API, as if the platform had given up on it:
kubectl -n datastores port-forward svc/rabbitmq 15672:15672 &curl -s -u lab:lab-only-rabbit -H "content-type: application/json" \ -X POST http://localhost:15672/api/exchanges/nw/amq.default/publish \ -d '{"properties":{},"routing_key":"timeline-service-queue-dead-letter","payload":"lab-poison-message","payload_encoding":"string"}'-
Find the dead-letter queue that now holds a message: open
http://localhost:15672(userlab, the lab password), Queues, and look for a…-dead-letterqueue with a count above0.Screenshot pending RabbitMQ management Queues tab for the nw virtual host, with timeline-service-queue-dead-letter holding one message What to notice: the work queue is empty and has its consumer; only the dead-letter queue holds the message, waiting for your decision.
-
Inspect it without removing it: open the queue, Get messages, with Ack mode set to Nack message requeue true, and read the payload.
-
Decide: replay or purge? Write your reasoning in the note first.
-
Act on your decision: Purge Messages on that dead-letter queue if it is poison.
-
Verify: the dead-letter queue is at
0, and the timeline queue has its consumer.
Incident 3: “Scheduled reminders stopped after this morning’s change” (13 minutes)
Section titled “Incident 3: “Scheduled reminders stopped after this morning’s change” (13 minutes)”Injection: an upgrade with a mistyped database host:
helm upgrade nw ./osos -n northwind $values \ --set scheduler.config.mongodb.url="mongodb://mongo-x.datastores.svc.cluster.local:27017/nw-scheduler?replicaSet=rs0" \ --wait --timeout 3m- Work the incident from the symptom. Useful evidence:
helm history, the scheduler pod’s state, its events and its previous logs. - Stabilise with the release’s own history, not with a new hand-made fix.
- Verify: the scheduler pod ready,
helm historyshowing the rollback, and the smoke test.
Check.
- Incident 1: indexing restored through
helm upgrade, and its queue drained. - Incident 2: the poisoned message inspected before it was removed, and your reasoning written down.
- Incident 3: the release rolled back to the last good revision, and the scheduler ready.
- Each incident has a note with times, the layer and store, and how you verified it.
- No incident took more than its time limit, or your note says why it did.
- No step used
FLUSHALL, deleted a queue, or edited a Deployment by hand.
Pass condition. All six checks hold.
If something goes wrong
| What you see | What to do |
|---|---|
| Incident 2: no dead-letter queue fills | Check the injection’s routing key: timeline-service-queue-dead-letter, on the nw virtual host. |
| Incident 2: Get messages removed the message | Ack mode was not Nack message requeue true. Nothing is lost in the drill; note it, and use the right mode next time. |
| Incident 3: the upgrade did not fail | The host may resolve in your cluster; use an obviously wrong host such as mongo-x. |
| Incident 3: the rollback waits | kubectl -n northwind describe pod on the scheduler; the previous revision should start within a minute. |
| You ran out of time | Finish the incident anyway, and record how long it took. The time limit is there to make you notice where time went. |
Model answer
Incident 1. Layer and store: everything works but search is late: the bus and the indexing
workers. list_queues shows indexing-service-queue with 0 consumers and messages waiting;
kubectl get pods shows no indexing pod. Restoring the release to its values (helm upgrade with the
same files) brings the replica back; the queue drains to 0. Sooner: an alert on a service queue
with no consumer, and on readiness (M5-S1). Using helm upgrade rather than kubectl scale keeps the
cluster equal to the values.
Incident 2. Layer and store: the bus. timeline-service-queue-dead-letter holds one message
whose payload is lab-poison-message, not a platform event. Decision: purge, because no fix makes
this message valid, and replaying it would only send it back after five retries. Before purging, its
payload and time are recorded in the note. Had the dead letters been real events from an outage,
the decision would have been the opposite: fix the cause, then move them back in small batches.
Sooner: an alert on any dead-letter queue above 0.
Incident 3. Layer and store: a failed release; the scheduler cannot reach its MongoDB.
helm history shows the newest revision failed; the scheduler pod is not ready and its log shows a
connection error to mongo-x. Stabilise: helm rollback nw <last deployed revision> -n northwind --wait;
no migration ran in the failed revision, so the rollback is complete (M2-S3). Sooner: a render-and-diff
step before every upgrade, and a values review by a second person.
✳ Discussion (8 min) — The blameless review
Section titled “✳ Discussion (8 min) — The blameless review”Pick incident 3. In a blameless review the question is never “who typed the wrong host?” but “what let a wrong host reach production, and what will catch it next time?”
- List two changes to the process (not to people) that would have stopped incident 3.
- Which signal would have told you first, before a user did?
With a facilitator. Pairs swap incident notes and review each other’s incident 3 for five minutes, then each pair shares its best process change; the room keeps the top three.
On your own. Write your answers to both prompts, then compare with the model answer.
Model answer
- Process changes. Render and diff every upgrade against the running release before applying it
(M2-S3), with the diff reviewed by a second person; keep values changes in Git with a pull request,
so a stray
--seton the command line is not how production changes. A staging release that receives the same values first catches a wrong host before production does. - Earliest signal. The upgrade itself:
--waitfailed after three minutes and Helm marked the revisionfailed. Treat a failed upgrade as an incident at once, and alert on any release pod not ready for five minutes, so a failure outside a watched upgrade is caught too.
✓ Practice (5 min) — Check your understanding
Section titled “✓ Practice (5 min) — Check your understanding”A dead-letter queue holds 30 messages that are real DataEntryCreated events, dead-lettered while
the reaction application’s database was unreachable for an hour. The database is back. What do you
do?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
Why inspect a dead-letter queue with Nack message requeue true?
Check your answer
The correct answer is A. Open the explanation under each option to see why.
During an incident, an engineer fixes a stopped worker with kubectl scale --replicas=1. Why does the
drill restore it with helm upgrade instead?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
Which line belongs in a blameless incident review?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
↺ Recap (1 min) — After Module 7 you can
Section titled “↺ Recap (1 min) — After Module 7 you can”After this module you can turn a reported symptom into a layer, a store and a runbook, recover the common incidents on a live release, handle a dead-letter queue safely, use the combined-pod rollback ladder, and write and review incidents so the next one is shorter.
Next. Module 8 looks beyond one release: how tenants are provisioned, moved and retired in a multi-tenant deployment, and what the function and package services are for.