Skip to content
On-call drill

Drill: Database Night

Every alert tonight comes from Kestrel's PostgreSQL. Tell a database that is down from one that is full, locked or unreachable, and bring it back.
  • Advanced
  • 30 min
  • Drill
  • Chaos Gym
  • Incident response
  • PostgreSQL
  • Databases

Overview

Tonight the trouble is in Kestrel's database. PostgreSQL 14 holds every store's stock and every order; the orders API connects to it as the kestrel role over the local Unix socket, opening a fresh connection for each request. Your own account is a PostgreSQL superuser, so psql kestrel works.

A database can fail in more ways than down. When the API reports trouble, the database's own views and its log will tell you far more than the API's error does.

When a probe goes red, declare an incident and pick the area you suspect, then find the cause and repair it. The probes decide when the service is back; you do not mark it fixed. Keep notes as you go, and afterwards write a short postmortem (symptom, root cause, fix); the debrief then shows what was really injected, so you can compare.

What done looks like

  • Tell apart a database that is stopped, full, locked or unreachable
  • Find the session or process behind a database outage and end only that
  • Keep downtime inside the error budget
  • Write a postmortem: symptom, root cause, fix

Before you start

  • Drill: Kestrel On Call first, or equivalent Linux, nginx and PostgreSQL familiarity
  • Assessed drill: no hints; personal best only

Learn the skills first