Free self-study · No account needed · Progress stays in this browser. Back it up before clearing site data or changing devices.

← Week 20: Reliability Engineering

Week 20 / Lesson 3

Responding to an incident and recording recovery

Use an operational runbook to contain, recover, and verify a failure.

Section 3.1 1 of 7

Overview

Focus

Use an operational runbook to contain, recover, and verify a failure.

Your route through the lesson

  • 3.2 Detection, incident scope, and ownership
  • 3.3 Containment and runbook decisions
  • 3.4 Recovery checks and audit evidence
  • 3.5 Put it into practice
  • 3.6 Guided comparison
  • 3.7 An incident with incomplete effect records

All required teaching is included here. Review selections are saved. Choose a correct answer for every question to continue; retries are unlimited. Study time and personal notes are optional.

Section 3.2 2 of 7

Detection, incident scope, and ownership

Focus

Detect an incident, define affected scope, and assign operational ownership.

An incident is a disruption requiring coordinated operational action, not merely any failed test. Detection can come from an alert, user report, audit event, or missing expected effect. Define a trigger tied to observable behavior, such as unauthorized retrieval, growing queue age, or a sustained increase in evidence-unavailable results.

Scope answers which identities, requests, time interval, versions, and effects may be affected. If index i2 was activated at ten minutes past the hour, traces from i1 outside that window may be unaffected. Preserve uncertainty when effect records are incomplete. A missing log does not prove nothing happened.

Assign an incident owner for decisions, a technical operator for changes, and a record keeper when staffing permits. In a one-person local drill, these are responsibilities rather than fictional colleagues. Record decisions and evidence as they occur. Begin with containment priorities: stop unauthorized effects and limit further harm, then restore useful service. A fast answer metric must not keep a leaking route active simply because most requests still appear successful. The operational record should explain why the chosen scope and response were justified.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. An alert shows unauthorized retrieval on index i2. What defines useful initial scope?
2. A local drill has one learner. How should incident roles be described?
3. No effect log exists for one request. What is justified?

Section 3.3 3 of 7

Containment and runbook decisions

Focus

Follow a runbook whose containment actions preserve evidence and permission boundaries.

A runbook is an executable decision guide for a specific operational problem. It names the trigger, required access, containment steps, recovery procedure, verification checks, escalation condition, and rollback point. Commands should be precise enough to run in the intended environment, with clear expected observations and stop conditions.

For a faulty retrieval release, containment may pause the affected route, preserve logs and manifests, and keep unrelated status checks available. Do not delete evidence to make alerts disappear. Do not globally disable authorization to restore answer volume. If the fault is isolated to one index, choose the narrowest effective containment that prevents further unsafe behavior.

Before retrying pending actions, reconcile operation records. An operation marked committed should not be repeated merely because its response was lost. A pending intent may require checking the effect system. Record who or what authorized each operational mutation. In this course's local drill, those mutations affect only synthetic state. The same decision logic transfers to real systems, where effects and permissions must be understood before executing changes. Runbooks should reduce improvisation while still requiring evidence-based judgment when the observed state differs from their assumptions.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. A route leaks data. Which containment is appropriate?
2. A durable record says op-7 committed but the response is absent. What should happen before retry?
3. A runbook step encounters an unexpected schema. What is appropriate?

Section 3.4 4 of 7

Recovery checks and audit evidence

Focus

Verify recovery with behavioral checks and retain an honest timeline.

Recovery means the affected service again meets its declared behavior, with uncertain effects reconciled or explicitly contained. A process starting successfully is only one observation. Verify supported answers, permission denials, persisted operations, and release compatibility through the same interfaces clients use.

A timeline records detection, containment, restoration, verification, and resumption. Distinguish event time from discovery time: an effect may occur before anyone notices it. Use trace and operation identifiers to link the timeline to evidence. If a period has missing telemetry, mark the gap rather than inventing a precise timestamp.

An audit record should explain configuration changes, permissions used, gate results, affected requests, and unresolved risks. Retrospective analysis asks what mechanism allowed the incident and what change would prevent recurrence. It does not need an essay to satisfy a learning checkpoint; a structured local record with actual assertions is enough. Measure recovery duration only from defined start and end events. A fake-clock drill can prove ordering and accounting, but it cannot establish a real service restoration time or an operator response-time objective.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. A process restarts but an unauthorized request succeeds. Is recovery verified?
2. An effect occurred at 10:00 and was discovered at 10:05. What should a timeline preserve?
3. A fake-clock drill reports recovery at 40 milliseconds. What does that establish?

Section 3.5 5 of 7

Put it into practice

Focus

Execute a time-bounded incident drill and verify effects before resuming admission.

Save week20.py and run python week20.py --lesson 3. The script uses a dictionary for service state and a list for timeline events. Its nested event function appends the current fake-clock time, then advances it by ten milliseconds. The output is explicitly labeled simulated_timeline.

The drill detects missing evidence, pauses the affected route, reconciles op-1 as already committed, restores the good release, runs success and permission checks, and resumes admission. Expected invariants are one retained effect, no duplicate operation, a good active release, and admission enabled only after verification. Each event is tied to a concrete state transition.

Extend this same drill by adding a pending operation whose effect status is unknown. Make the runbook keep it contained instead of inventing completion. Add an assertion that resumption of ordinary reads does not imply permission to repeat that uncertain mutation. This remains a synthetic local incident with a fake clock; it does not claim a real outage occurred or that an external operator approved the response. No account, network request, or long-running process is required.

Download this week’s Python lab ↓

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. The drill finds op-1 already committed. What effect count should remain after recovery?
2. A pending operation has unknown external status. What should the extension do?
3. When should admission resume in the drill?

Section 3.6 6 of 7

Guided comparison

Focus

Explain how a recovery timeline connects decisions to verified state.

The supplied timeline begins at simulated time zero with detection. Containment follows at ten, reconciliation at twenty, verification at thirty, and resumption at forty. The fake clock advances after each event, so its final internal value is fifty. Do not confuse that final counter with the timestamp of the last event.

The important proof is the state relationship: the route is paused before reconciliation, the committed effect is not repeated, and admission resumes only after the restored manifest passes checks. If the event list merely printed those words without state assertions, it would be a report template rather than an executed drill. Here assertions connect the record to the modeled state.

For the integrated platform, replace the dictionary restoration with an actual local service restart and persisted effect query. Keep the same decision structure and label any remaining fixtures. The weekly milestone combines evaluation cases, enforced permission checks, release identity, and recovery records into one coherent artifact. It does not require claiming production readiness from a synthetic incident. The defensible result is a reproducible local recovery sequence with explicit limits.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. Events occur at 0,10,20,30,40; the clock advances after each. What is the final counter?
2. A script prints recovery steps but never checks state. What is missing?
3. A local synthetic milestone passes. Which readiness claim is justified?

Section 3.7 7 of 7

An incident with incomplete effect records

Focus

Recover carefully when a tool effect exists but its acknowledgement is missing.

A ticket service receives operation op-42, commits the ticket, and crashes before returning its identifier. The assistant's trace records a timeout, while the durable tool ledger records a committed effect. An incident responder who looks only at the trace may assume failure and rerun the request with op-43, creating a duplicate ticket.

The correct runbook queries the ledger by op-42, retrieves the existing result, and marks the original request reconciled. It then verifies that the user is still permitted to see that result. Recovery does not allow one user's operation identifier to reveal another user's ticket. A trace identifier helps diagnostics, while an operation identifier plus ownership controls effect retrieval.

If the effect system cannot be queried, record uncertainty and stop automatic mutation retries. Ordinary read service may resume after its own checks while that operation remains quarantined. The report should distinguish partial service restoration from complete effect reconciliation. This avoids turning a successful-looking demonstration into a claim that every outstanding action is resolved when evidence is still missing.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. A ledger says op-42 committed while the trace timed out. Which recovery is appropriate?
2. A user knows another user’s operation identifier. What still governs result retrieval?
3. Read service is healthy but one mutation remains uncertain. How should recovery be reported?

Your personal notes

Optional, ungraded, and saved only in this browser. Export a backup from the Academy homepage to keep them.

References and further reading
Ask your own AI assistant

Copy this prompt into an assistant you already use. Nothing is sent automatically, and your personal notes are not included.

Next lesson: Choosing a model that fits the machine →