Incident Postmortem: INC-2026-089 — Checkout Webhook Queue Stall

[!NOTE] This is a blameless postmortem. We assume everyone acted with the best information available at the time and focus on improving systems, guardrails, and observability.


1. Executive Summary

Between 14:12 UTC and 14:59 UTC, payment confirmation webhooks stalled in the primary worker pool after a routine database index migration acquired an unexpected table lock on billing_events. 1,420 customers experienced delayed order confirmation emails and dashboard status updates; zero payments were lost or double-charged.

Impact Metrics

Metric Value Baseline
Total duration 47 min —
Affected webhook deliveries 1,420 0
Failed payment charges 0 0
Peak queue depth 18,900 messages < 50
Time to detect (TTD) 6 min < 2 min target
Time to mitigate (TTM) 41 min < 15 min target

2. Incident Timeline (UTC)

Time Event
14:09 Deploy v2.48.0 starts, running migration 20260414_add_billing_idx.sql.
14:12 CREATE INDEX (without CONCURRENTLY) blocks writes on billing_events.
14:18 Alert fires: WebhookQueueDepthHigh > 5,000. On-call acknowledges.
14:24 On-call identifies lock wait chains in pg_stat_activity; SEV-1 declared.
14:31 Migration query terminated via pg_cancel_backend(); lock released.
14:35 Worker pool scaled from 4 to 16 replicas to drain backlog.
14:52 Queue depth returns below 100; webhook p95 latency normalizes.
14:59 All delayed confirmations verified delivered; incident resolved.

3. Root Cause Analysis (Fault Tree)

[Diagram]

Contributing Factors

  1. Missing CONCURRENTLY keyword: The index migration was tested on staging (12k rows, < 1s) where locking was imperceptible, whereas production had 48M rows.
  2. No lock_timeout guardrail: The migration runner used PostgreSQL's infinite default lock wait.
  3. Delayed alerting: The queue depth alert only triggered at 5,000 messages instead of alerting on consumer age (oldest_message_age > 60s).

4. What Went Well vs. What Could Be Better

What Went Well

Where We Got Lucky


5. Action Items

ID Action Item Priority Owner Due Date Status
AI-1 Enforce squawk SQL linter in CI to block non-concurrent index creation P0 Platform 2026-04-18 Done
AI-2 Set SET lock_timeout = '3s' and statement_timeout = '30s' in migration runner P0 Core Infra 2026-04-19 In Progress
AI-3 Add alert on webhook_oldest_message_age_seconds > 60 P1 SRE 2026-04-22 Open
AI-4 Add pg_locks contention widget to Payments Overview dashboard P2 Payments 2026-04-26 Open