Skip to content

Operations Drills Runbook

This runbook defines recurring resilience drills and backup rehearsals for OpenCodeHub staging/production readiness.

  • Redis outage behavior
  • PostgreSQL reconnect behavior
  • Backup + restore rehearsal
  • CI failure ownership and escalation
  • Docker + Docker Compose available
  • Services runnable via docker-compose.yml
  • Access to app health endpoint (/api/health)

See .github/ci/failure-ownership-map.md for lane ownership, SLA, and escalation.

Run:

Terminal window
npm run drill:redis

Artifacts:

  • test-results/drills/redis-drill-baseline-health.json
  • test-results/drills/redis-drill-degraded-health.json
  • test-results/drills/redis-drill-recovered-health.json
  • test-results/drills/redis-drill-app.log

Expected outcomes:

  1. Service remains responsive (may degrade, but should not crash loop).
  2. Health report shows redis/scaling impact while Redis is down.
  3. Health and behavior recover after Redis restart.

Run:

Terminal window
npm run drill:postgres

Artifacts:

  • test-results/drills/postgres-drill-baseline-health.json
  • test-results/drills/postgres-drill-degraded-health.json
  • test-results/drills/postgres-drill-recovered-health.json
  • test-results/drills/postgres-drill-app.log

Expected outcomes:

  1. Health endpoint indicates database failure during outage.
  2. App reconnects when PostgreSQL is restored.
  3. No persistent crash state after recovery.

Safe (non-destructive) rehearsal:

Terminal window
npm run drill:backup-restore

Full rehearsal (destructive restore path):

Terminal window
RESTORE_MODE=full npm run drill:backup-restore

Artifacts:

  • test-results/drills/backup-drill.log
  • test-results/drills/backup-verify-drill.log
  • test-results/drills/restore-drill.log

Expected outcomes:

  1. Backup archive is generated.
  2. Backup verification passes checksum and manifest checks.
  3. Restore path executes successfully in selected mode.
  • Redis outage drill: weekly
  • PostgreSQL reconnect drill: weekly
  • Backup+restore rehearsal: weekly (safe), monthly (full)

Capture for each run:

  • Date/time
  • Operator
  • Environment
  • Result (pass/fail)
  • Mean time to recovery (if outage simulated)
  • Follow-up action items